Hello Cristina,
I understand that you are trying to use “ode45” to solve system of equations but getting an error that variable “t” is not recognised.
This might be happening because of wrong function handles. When the equations or function handles are defined you should also include the variable “t” in the list of variables. It should be done like the example below.
yprime = @(t,y) -2*y + 2*cos(t).*sin(2*t);
Or during the call of “ode45” function add the variables in the input as below.
[t,y] = ode45(@(t,y) 2*t, tspan, y0);
Not including “t” in the above handle, in the bracket after “@” might be causing the error. Even if the equations do not involve “t” it should be added because they are differential equations with respect to time.
You can refer to the below documentation to learn more about ode45.
Hope this helps.
Thanks,
Charan.