Logarithmic, Power, and Exponential Fit
12 views (last 30 days)
Show older comments
I am trying to find the slope and intercept values for a Logarithmic, Power, and Exponential fit for my X and Y data series. I am looking for the r^2 value as well. This is the code I used in 2013, which isn't working for me anymore:
[sl,in]=logfit(x,y,'logx') %log fit
[sl,in]=logfit(x,y,'loglog') %power fit
[sl,in]=logfit(x,y,'logy') %exponential fit
The command window says it does not recognize the 'logfit' command, then asks if I meant 'lognfit'. When I change the command to 'lognfit' the output says "X and CENSORING must have the same size."
Any advice?? I have the student version of Matlab.
0 Comments
Accepted Answer
Geoff Hayes
on 15 Oct 2014
logfit doesn't appear to be a MATLAB function (from either the base version or the Statistics Toolbox) so you may be referring to Jonathan C. Lansey's FEX submission which has the same function signature as what you have shown above. Download the logfit function from Power Law, Exponential and Logarithmic Fit, add the file to a folder within your MATLAB search path, and try running the above statements again.
More Answers (0)
See Also
Categories
Find more on Get Started with Curve Fitting Toolbox 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!