I have been using matlabFunction
rather extensively in my computational physics class, and I was hoping someone could help me understand what exactly is going on with this command (is matlabFunction
a command?). I have read what the MathWorks website provides regarding matlabFunction
, but was hoping for some clarification.
For instance, we dealt with Lorenz equations, a chaotic system. This is a system of differential equations:
dx/dt = s*(y-x), dy/dt = -x*z+r*x-y, dz/dt = x*y-b*z.
We used matlabFunction
as such:
matlabFunction([s*(y-x);-x*z+r*x-y; x*y-b*z],...
'vars', {t,[x;y;z],[s;r;b]},...
'file', 'Example2');
I understand that [s*(y-x);-x*z+r*x-y; x*y-b*z]
is a column vector containing our unknown functions (in this case, they are derivatives with respect to time), which we use to approximate the functions x(t), y(t), and z(t) with ode45
.
My question is, how is [s*(y-x);-x*z+r*x-y; x*y-b*z]
related to {t,[x;y;z],[s;r;b]}
? Evidently the order matters, but I don't quite understand this. I think I would understand this if I knew the relationship between the two.
If you feel that I have not provided enough information, please let me know.