Filter löschen
Filter löschen

How can i define my own handle weight function in "nlinfit "command in MATLAB

2 Ansichten (letzte 30 Tage)
Dear ALL; Suppose have data, x = (1:10)'; y = 10 - 2*x + randn(10,1); beta0=[10,-2];(initial values vector), modelfun=@(b,x)(b(1)+(b(2))*x); (linear model is taken intentionally).Now when i run nlinfit i get my beta as options = statset('Display','iter','RobustWgtFun','bisquare');[beta]=nlinfit(x,y,modelfun,beta0,options).This function give me the answer for linear model but using bisquare weight function as i have given in options.Suppose i want to define my own weight function like w= 1 ./ (1 + r.^4).How can i do it ?I mean how can i adjust my own weight function in nlinfit command.
Thanks

Antworten (0)

Kategorien

Mehr zu Get Started with Curve Fitting Toolbox finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by