Fitting a smooth (logarithmic) curve
2 visualizaciones (últimos 30 días)
I need to fit a curve to the following equation:
u = a0 + (a1*z) + (a2*lnz)
so that I get the coefficients a1 and a2. I have arrays u(z) and z, and I believe I might need to use nlinfit, but I'm not entirely clear on how to define my own "modelfun"
John D'Errico el 23 de Mayo de 2017
This is not a nonlinear problem in the unknown coefficients. Use regress, since you have the stats toolbox. You could even use backslash, but regress gives you more information.
By the way, lnz is not how you compute the natural log. Use log.