Effacer les filtres
Effacer les filtres

Error in fzero function

1 vue (au cours des 30 derniers jours)
strunack
strunack le 27 Nov 2012
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

Réponse acceptée

Walter Roberson
Walter Roberson le 27 Nov 2012
findzero=fzero(@(x) myfun(x,xdata),[-12 -7])

Plus de réponses (0)

Catégories

En savoir plus sur Optimization dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by