MATLAB: Not enough input arguments.

not enough input argumentsode system

Hi everybody
I am trying to solve a couples ODE system, I wrote the code below but it has an error. I changed the code several times but it didnt work. How can I fix it???
thank you.

Best Answer

More like this:
t=0:0.1:5;
x0=0;
xdot0=5;
z0=[x0,xdot0];
[T,Z]=ode45(@motor,t,z0); % Note @motor, not just motor.
plot(T,Z)
function Zdot=motor(t,Z)
Zdot=zeros(2,1);
Rs=0.1;
Ls=0.5;
W=314;
%B=0;
Zdot(1)=(-Rs*Z(1)+100*sin(W*t))/Ls;
Zdot(2)=(-Rs*Z(2)+100*sin(W*t-(pi/2)))/Ls;
end
(code executed by @Rik)