MATLAB (Matrix Laboratory) is a Programming Language.

General Commands:

whos returns a list of all variables Calling a .m file without the suffix runs it

State Space Model:

For the example:

We can represent this in matlab with:

function xdot = msdmodel(x,f)
 
xdot(1) = x(2);
xdot(2) = -K/M*x(1) - C/M*x(2) + f/M;