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. '''
조회 수: 1 (최근 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!