Error in 1st line of code

4 views (last 30 days)
Manali Kunte
Manali Kunte on 28 Nov 2020
Hello. I am new to MATLAB and keep on getting this error every single time:
Error in MSDSOLV (line 1)
[T,Y]= ode45(@MSD,[0 10],[0.3,-0.1]);
This is my MSD code for the differential equations:
function dx=MSD (t,x);
dx=zeroes(2,1);
A=[0 1;-1 -2]
B=[0;1]
J=[-1+i -1-i]
K=acker(A,B,J)
u=-K*[x(1);x(2)]
dx(1)=x(2);
dx(2)=-x(1)-2*x(2)+u;
and this is my solver code for teh differential equations:
[T,Y]= ode45(@MSD,[0:0.1:10],[0.3,-0.1]);
figure(1)
plot(T,Y(:,1),'b')
grid
xlabel('time (s)')
ylabel ('x_1')
Thanks in advance

Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!