Passing extra arguments to `nlinfit` function
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Pankaj
am 19 Jul. 2018
Bearbeitet: Pankaj
am 1 Aug. 2020
I am in interested in passing extra arguments to nlinfit function in Matlab
beta = nlinfit(X,Y,modelfun,beta0)
and let the modelfun is
function y = modelfun(beta, c, X)
y = beta(1)*x.^(beta2) + c;
My interest is to estimate beta and also to provide c externally. X and Y have their obvious meanings.
Can it be done?
0 Kommentare
Akzeptierte Antwort
Star Strider
am 19 Jul. 2018
Your function must have your parameter vector as the first argument, your independent variable as the second argument, and any added parameters after that.
Try this:
Beta = nlinfit(X,Y,@(beta,X)modelfun(beta, c, X),beta0)
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Statistics and Machine Learning Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!