%%%Mass Matrix: % Note: % Using a mass matrix M is an option. to solve problems of the type: % M * x_dot = f(x) function m = M(t,x) %define your mass matrix 'm' as a function of your state x (and if %needed of time t) here.