Not enough inputs to inline function.
显示 更早的评论
when I deal with a control system simulation,that error always happens.I am a freshman.
Code:
pi=3.1415926;
x=0:0.001:100;
y1=exp(-pi.*x./((1-x.^2).^2))-0.3;
ks=fzero(f1,0.1);
y2=(pi./(x.*(1-(k).^2)))-0.1;
omiga=fzero(f2,[0 100]);
num=omiga*omiga;
den=[1 2*ks*omiga omiga*omiga];
step(num,den,1)
error :
>> autocon0303
Error using fzero (line 233)
FZERO cannot continue because user supplied inline object ==> f2 failed with the error below.
Not enough inputs to inline function.
Error in autocon0303 (line 6)
omiga=fzero(f2,[0 100]);
回答(1 个)
Walter Roberson
2013-10-14
0 个投票
You do not show us any source for f1 or f2.
You calculate y1 and y2 as expressions, but you do not use them. You calculate ks but you do not use it.
Your expression for y2 involves the undefined variable "k".
Note: it would probably be better to not redefine "pi" as MATLAB has that built in.
类别
在 帮助中心 和 File Exchange 中查找有关 Function Creation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!