Not enough inputs to inline function.

조회 수: 5 (최근 30일)
Lee
Lee 2013년 10월 14일
답변: Walter Roberson 2013년 10월 14일
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
Walter Roberson 2013년 10월 14일
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.

카테고리

Help CenterFile Exchange에서 Function Creation에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by