フィルターのクリア

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 Center および File ExchangeOptimization についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by