Power Law, Exponential and Logarithmic Fit

버전 1.5.0.0 (20.9 KB) 작성자: Jonathan C. Lansey
Finds and plots the linear fit to some data points when plotted on a log scale.
다운로드 수: 14K
업데이트 날짜: 2014/8/22

라이선스 보기

logfit(X,Y,graphType), where X is a vector and Y is a vector or a
matrix will plot the data with the axis scaling determined
by graphType as follows: graphType-> xscale, yscale
loglog-> log, log
logx -> log, linear
logy -> linear, log
linear -> linear, linear
A line is then fit to the scaled data in a least squares
sense.
See the 'notes' section below for help choosing a method.
logfit(X,Y), will search through all the possible axis scalings and
finish with the one that incurs the least error (with error
measured as least squares on the linear-linear data.)

Notes:
A power law relationship
[slope, intercept] = logfit(x,y,'loglog');
yApprox = (10^intercept)*x.^(slope);

An exponential relationship
[slope, intercept] = logfit(x,y,'logy');
yApprox = (10^intercept)*(10^slope).^x;

A logarithmic relationship
[slope, intercept] = logfit(x,y,'logx');
yApprox = (intercept)+(slope)*log10(x);

A linear relationship
[slope, intercept] = logfit(x,y,'linear');
yApprox = (intercept)+(slope)*x;

인용 양식

Jonathan C. Lansey (2024). Power Law, Exponential and Logarithmic Fit (https://www.mathworks.com/matlabcentral/fileexchange/29545-power-law-exponential-and-logarithmic-fit), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2010b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Interpolation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.5.0.0

Added new color option which lets you set the 'color' of both lines and markers with one parameter. Added robustness to NaN values.

1.4.0.0

Updated to use R2 as 'best fit' criterion rather than MSE

1.3.0.0

fixed 'skipbegin' feature functionality

1.2.0.0

Updated to include Mean Squared Error

1.0.0.0