Not enough input arguments
4 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(3 个)
Matt Tearle
2011-11-29
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
0 个评论
Jan
2011-11-29
I guess, that you have a function called "t":
which t
Please post the complete error message in the future. It contains helpful information.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Symbolic Math Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!