Not enough inputs to inline function.
2 views (last 30 days)
Show older comments
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]);
0 Comments
Answers (1)
Walter Roberson
on 14 Oct 2013
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.
0 Comments
See Also
Categories
Find more on Function Creation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!