필터 지우기
필터 지우기

Error in fzero function

조회 수: 1 (최근 30일)
strunack
strunack 2012년 11월 27일
I have a function
function F = myfun(x,xdata)
F =x(1)*sin((2*pi/x(2))*xdata+x(3));
with lsqrcurvefit i got x=[0.3559 14.2775 0.6573]
the function has several zero crossing. I want to find the zerocrossing in the interval of [t1 t2]
I used like this
findzero=fzero(@myfun(x,xdata),[-12 -7])
or
findzero=fzero(myfun(x,xdata),-8.5)
but it says error. it does nt take the command I have to pass x into myfun but it doesnt accept.
xdata is just a time series xdata=[-25:0.01:25]
pls help

채택된 답변

Walter Roberson
Walter Roberson 2012년 11월 27일
findzero=fzero(@(x) myfun(x,xdata),[-12 -7])

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by