资源简介
很好用的洛伦兹曲线拟合的源代码,已经验证可以完全调通
代码片段和文件信息
function [yprime params resnorm residual] = lorentzfit(xyp0boundsnparams)
% LORENTZFIT fits a single- or multi-parameter Lorentzian function to data
%
% LORENTZFIT(XY) returns YPRIME(X) a Lorentzian fit to the data
% found using LSQCURVEFIT. The function Y(X) is fit by the model:
% YPRIME(X) = P1./((X - P2).^2 + P3) + C.
%
% [YPRIME PARAMS RESNORM RESIDUAL] = LORENTZFIT(XY) returns YPRIME(X)
% values in addition to fit-parameters PARAMS = [P1 P2 P3 C]. The RESNORM
% and RESIDUAL outputs from LSQCURVEFIT are also returned.
%
% [...] = LORENTZFIT(XYP0) can be used to provide starting
% values (P0 = [P01 P02 P03 C0]) for the parameters in PARAMS.
%
% [...] = LORENTZFIT(XYP0BOUNDS) may be used to define lower
% and upper bounds for the possbile values for each parameter in PARAMS.
% BOUNDS = [LB1 LB2 LB3 LB4;
% UB1 UB2 UB3 UB4].
% If the user does not wish to manually define values for P0 it may be
% enetered as an empty matrix P0 = []. In this case default values will
% be used. The default bounds for all parameters are (-InfInf).
%
% [...] = LORENTZFIT(XYP0BOUNDSNPARAMS) may be used to specify the
% number of parameters used in the Lorentzian fitting function. The
% number of parameters defined in P0 and BOUNDS must match the function
% specified by NPARAMS. If the user does not wish to manually define
% values for P0 or BOUNDS both may be enetered as empty matricies:
% P0 = []; BOUNDS = [].
%
% -NPARAMS options
%
% ‘1‘ - Single parameter Lorentzian (no constant term)
% L1(X) = 1./(P1(X.^2 + 1))
%
% ‘1c‘ - Single parameter Lorentzian (with constant term)
% L1C(X) = 1./(P1(X.^2 + 1)) + C
%
% ‘2‘ - Two parameter Lorentzian (no constant term)
% L2(X) = P1./(X.^2 + P2)
%
% ‘2c‘ - Two parameter Lorentzian (with constant term)
% L2C(X) = P1./(X.^2 + P2) + C
%
% ‘3‘ - Three parameter Lorentzian (no constant term)
% L3(X) = P1./((X - P2).^2 + P3)
%
% [DEFAULT] ‘3c‘ - Three parameter Lorentzian (with constant term)
% L3C(X) = P1./((X - P2).^2 + P3) + C
%
% X and Y must be the same size numeric and non-complex. P0 and BOUNDS
% must also be numeric and non-complex. NPARAMS is a character array.
%
% Examples:
% x = -16:0.1:35;
% y = 19.4./((x - 7).^2 + 15.8) + randn(size(x))./10;
% [yprime1 params1 resnorm1 residual1] = lorentzfit(xy[20 10 15 0]);
% figure; plot(xy‘b.‘‘LineWidth‘2)
% hold on; plot(xyprime1‘r-‘‘LineWidth‘2)
%
% [yprime2 params2 resnorm2 residual2] = lorentzfit(xy[][]‘3‘);
% figure; plot(xy‘b.‘‘LineWidth‘2)
% hold on; plot(xyprime2‘r-‘‘LineWidth‘2)
%
% See also: lsqcurvefit.
% Jered R Wells
% 11/15/11
% jered [dot
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1326 2012-04-17 14:04 license.txt
文件 10577 2012-04-17 14:04 lorentzfit.m
- 上一篇:杭电数字图像处理作业
- 下一篇:RTPC sar面目标成像
相关资源
- 数据拟合方法
- 极限学习机的回归拟合及分类-对比试
- 磷酸铁锂电池充放电曲线和循环曲线
- Qt实现动态曲线图+文本数据的实时显
- MSChart控件绘制曲线
- CAD曲线转多段线测绘插件.rar
- 最小二乘法线性非线性拟合
- 测量MOS电容的伏容特性曲线
- Bezier曲线曲面绘制
- unity曲线滑动
- QT5 实时曲线绘制
- LabVIEW的图形控件中游标与曲线的交点
- 步进电机S升降速曲线编程思路
- DrawLine.rar
- ukf直线跟踪,提供详细代码,误差曲
- VC读取数据库数据并绘曲线图.rar
- 二次曲面拟合实现高程模型建立
- 抽水试验Q-S曲线拟合
- Faster_RCNN绘制P-R曲线、检测视频
- 数据拟合方法实现飞行物体运动轨迹
- 基于miracl库的椭圆曲线算法实现
- 缓和曲线计算公式及程序
- QT中利用QCustomPlot类画曲线图
- 椭圆曲线加密算法密钥生成器
- 有源滤波器幅频特性曲线对数坐标纸
- 论文研究 - 人格影响双曲线贴现
- 辽宁省环境污染与经济增长关系的实
- 基于Surfer的平原区域GPS高程拟合应用
- 基于洛伦兹力的MEMS磁传感器设计及制
- TVS二极管特性曲线图_TVS二极管应用
评论
共有 条评论