Not enough input arguments
Ältere Kommentare anzeigen
function dy= test(t,y)
dy = zeros(2,1);
dy(1)=t-y(1)./t;
dy(2)=y(1)./t-y(2).*t; (error in this line)
Error using test(line 3) Not enough input arguments
Can somebody help me to find the problem please? Thanks
1 Kommentar
Jan
am 29 Nov. 2011
Please format your code as explained in the "Markup help" link on this page.
Antworten (3)
Matt Tearle
am 29 Nov. 2011
From your comment to Jan: "then run it"...
If you are running it as a script then it will give this error message because test is a function, requiring t and y to be passed in as arguments. Call it as a function and it should work fine:
>> test(pi,rand(2,1))
ans =
3.1230e+000
-2.9509e+000
Walter Roberson
am 29 Nov. 2011
0 Stimmen
What arguments are you passing to test when you invoke it?
Kategorien
Mehr zu Symbolic Math Toolbox finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!