fitgaussian

版本 1.0.0.0 (10.3 KB) 作者: Mehmet OZTURK
fit a gaussian like curve to data
2.9K 次下载
更新时间 2008/2/18

查看许可证

FITGAUSS is a function to fit a gaussian like curve "f" to experimental data by Marquardt-Levenberg non-linear least squares minimization. The fitting function has a form of a*exp(-((x-b)/c)^2)+d*x+e. This means the curve is build up a line and a gaussian. INPUTS: "x,y" is input data. "init" is initial guess for parameteres [a b c d e]. If is empty they will be determined automatically from input data and "w" is weight vector (default is ones(size(x))). OUTPUTS: "f" is the values of fitted function. "X" is the estimated parameters. "err" is the normalized error. "it" is number of iterations. "extreme" function from Lic. on Physics Carlos Adrián Vargas Aguilera is used in this function.

Example:
x=1:100;
a=30; b=45; c=10; d=.3; e=20;
f=a*exp(-((x-b)./c).^2)+d*x+e;
fn=f+2*randn(size(f));
[F X]=fitgauss(x,fn);
X=
29.61, 45.20, 10.20, 0.31, 19.18
plot(x,fn,'.',x,F,'r')

引用格式

Mehmet OZTURK (2024). fitgaussian (https://www.mathworks.com/matlabcentral/fileexchange/15262-fitgaussian), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R2007a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Linear and Nonlinear Regression 的更多信息
致谢

启发作品: lm_plots

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.0.0.0

Update to include missing file "frepmat". User can also use repmat instead of frepmat.