Info
この質問は閉じられています。 編集または回答するには再度開いてください。
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 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
Torsten
2018 年 2 月 1 日
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.
回答 (0 件)
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!