Not enough inputs to inline function.

5 vues (au cours des 30 derniers jours)
Lee
Lee le 14 Oct 2013
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]);

Réponses (1)

Walter Roberson
Walter Roberson le 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.

Catégories

En savoir plus sur Function Creation dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by