Fitting a smooth (logarithmic) curve
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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"
0 commentaires
Réponses (1)
John D'Errico
le 23 Mai 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.
help slash
help regress
By the way, lnz is not how you compute the natural log. Use log.
0 commentaires
Voir également
Catégories
En savoir plus sur Regression dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!