How to fit a logarithmic curve to my data;

Hello everyone! Please, i need your feedback! I would like to to fit a log equation to my data but i cannot find it neither in curve fitting app nor in basic fitting in plots. How can i do it? Thanks in advance!

 Accepted Answer

Use lsqcurvefit (or fminsearch if you don't have the optimization toolbox).
Best wishes
Torsten.

4 Comments

Many thanks Torsten! I have also used fittype
myfittype=fittype('a +b*log(x)',...
'dependent', {'y'}, 'independent',{'x'},...
'coefficients' {'a,b'});
myfit=fit(x',y',myfittype);
However, MATLAB shows warning cause start point is not provided in fit. How can i put it?
Thanks again!
myfit=fit(x',y',myfittype,'StartPoint',[1 1]);
Best wishes
Torsten.

Sign in to comment.

More Answers (0)

Categories

Community Treasure Hunt

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

Start Hunting!