lsqcurvefit is undefined in MathLab version R2007b
Afficher commentaires plus anciens
Hello MathLab community,
I have copied follwong code from MathWorks example:
xdata = ...
[0.9 1.5 13.8 19.8 24.1 28.2 35.2 60.3 74.6 81.3];
ydata = ...
[455.2 428.6 124.1 67.3 43.2 28.1 13.1 -0.4 -1.3 -1.5];
fun = @(x,xdata)x(1)*exp(x(2)*xdata);
x0 = [100,-1];
x = lsqcurvefit(fun,x0,xdata,ydata)
Running this code gives following error:
??? Undefined function or method 'lsqcurvefit' for input arguments of type 'function_handle'.
Error in ==> Fitt_2 at 11
x = lsqcurvefit(fun,x0,xdata,ydata)
What is the problem in the code?
Can anybody help to solve?
I'm working with MathLab version R2007b.
Thank you.
3 commentaires
Rik
le 16 Jan 2022
Did you make sure to install the appropriate toolbox? The doc page states it was introduced before R2006a, so it did exist.
Matt J
le 16 Jan 2022
Max Heimann
le 16 Jan 2022
Modifié(e) : Max Heimann
le 16 Jan 2022
It seems to be part of the optimization toolbox.
https://mathworks.com/help/optim/ug/lsqcurvefit.html
Réponse acceptée
Plus de réponses (2)
Lieu-Kim Dang
le 17 Jan 2022
0 votes
1 commentaire
Rik
le 17 Jan 2022
You posted this comment as an answer. Please use the comment section for comments, as the order of answers can change.
Catégories
En savoir plus sur Solver Outputs and Iterative Display dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
