Info
This question is closed. Reopen it to edit or answer.
Please some one should help me traces this error in my code of system of o.d.e. The Matlab give me these error ''Error using kennie>loren Too many input arguments. '''
3 views (last 30 days)
Show older comments
function kennie
global a k
a=4;
k=4;
y0=[0 1 0 0];
[T,Y]=ode45(@loren,[0,10],y0,0.01,0.1);
disp([T,Y])
figure(1); plot(T,Y)
function dy=loren(t,y)
global a k
dy=zeros(4,1);
for j=1:k
for i=1:a
dy(1)=y(2);
dy(2)=y(3);
dy(3)=y(4);
dy(4)=(1/(k(j)+a(i)).^4)*y(3)-(2/(k(j)+a(i)))*y(4)-(1/(k(j)+a(i)).^3).*y(2)+(k(j)./(k(j)+a(i)).^3).*y(1).*y(2)-(k(j)./(k(j)+a(i))).*y(1).*y(4)+((k(j)./(k(j)+a(i)))).*y(2).*y(3)-(k(j)./(k(j)+a(i))).*y(1).*y(3)+(k(j)./(k(j)+a(i)).^2).*(y(2)).^2;
end
end
7 Comments
Torsten
on 1 Feb 2018
Why do you use the loop in function "loren" ?
You permanently overwrite the setting for dy(4) until in the end, you use k(length(k)) and a(length(a)) in its definition.
Best wishes
Torsten.
Answers (0)
This question is closed.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!