Nonlinear fit in MATLAB

3 visualizaciones (últimos 30 días)
Cole Butler
Cole Butler el 27 de Jun. de 2019
Comentada: Cole Butler el 27 de Jun. de 2019
Hello all,
I am trying to fit a function with one data set to another data set. I'm performing a nonlinear fit similar to something as follows:
y = c1.*x.^c2
where y and x are two column vectors, and I am trying to solve for c1 and c2. Although it's a pretty straightforward answer, I thought some guidance from the community would be best in this matter as I've little experience with the nonlinear fitting capabilities of MATLAB.
Cheers
  3 comentarios
Bjorn Gustavsson
Bjorn Gustavsson el 27 de Jun. de 2019
And if Walter's solution is not good enough, due to how noise in y is modified with the log, then use that solution to look for a minimization of
f = @(p,x,y) sum((y-p(1)*x.^p(2)).^2)
You can do that with fminsearc or, with minor modifications, lsqnonlin
Cole Butler
Cole Butler el 27 de Jun. de 2019
Thank you both for the suggestions!

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Get Started with Curve Fitting Toolbox en Help Center y File Exchange.

Productos


Versión

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by