I have this code:
for k = 1:3 Vx = Vx + dVx; dfd = 4; df = dfd*pi/180; a1 = 2*(Caf+Car)/Vx; a2 = (M*Vx^2+2*L1*Caf-2*L2*Car)/Vx; a3 = 2*(L1*Caf-L2*Car)/Vx; a4 = 2*(L1^2*Caf+L2^2*Car)/Vx; K = [a1,a2;a3,a4]; b = [2*Caf;2*L1*Caf]; A = -Minv*K; B = Minv*b; C = [1,0;0,1]; D = [0]; sys = ss(A,B,C,D); [y,t] = step(df*sys);end
And I am trying to find the ode for the state space to solve it.
I tried doing:
ode45(@(t,y) sys, 0:1:100, [0; 0])
But I am getting this error:
Error using odearguments (line 113)Inputs must be floats, namely single or double.
I am not sure how to find it. Again I am attempting to find the ode45 for the 2 equations I have in the state space.
Best Answer