How run lsqcurvefit correctly?
Show older comments
Hi, I'm using lsqcurvefit to find values of sa , for different data input, in a nolinear function. Sometime lsqcurvefit give me correct results but sometime it gives strange results with this message:
Local minimum found. Optimization completed because the size of the gradient is less than the default value of the function tolerance. criteria details
this is the code that I use:
fun1=@(sa,f1)(A.*g.^2./((2.*pi).^4.*f1.^5).*exp(-5./4.*(fp./f1).^4)).*gam.^exp(-0.5.*((f1-fp)./(sa.*fp)).^2);
options=optimset('MaxFunEvals',20000);
options=optimset('TolFun',10^-6);
options=optimset('MaxIter',10000);
options=optimset('TolX',10^-6);
li=0.001;
ls=0.2;
sa_new=lsqcurvefit(fun1,0.07,f1,S1,li,ls,options);
Where A,g,gam,fp are all parametres that I Know and f1 and S1 are the data that I have fit with function. Any suggest to find the correct values of sa? Thanks so much
Accepted Answer
More Answers (0)
Categories
Find more on Agriculture in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!