我是用cftool工具箱做双峰高斯拟合下面是数据
x=1492 1560 1628 1696 1763 1831 1899 1967 2035 2103 2170 2238 2306 2374 2442 2509 2577 2645 2713 2781 2849 2916 2984 3052 3120 3188 3256 3323 3391 3459 3527 3595 3662 3730 3798 3866 3934 4002 4069 4137 4205 4273 4341 4409 4680 4951 5222
yLibT1T5=-0.589227369860830 10.0898251163942 28.6363782687441 50.8864253711709 70.3045458493082 82.1772126314492 86.2628835110249 85.7656813233714 84.1316685690265 82.8472737216911 81.6465793583436 79.9131391225042 77.5414830310404 74.8977137826820 72.4979184797813 70.7685301897380 69.8387738422293 69.4516310347722 69.1402883210393 68.5148467570424 67.4105941984022 65.9242622613834 64.3841490302117 63.1214437593538 62.1497115979660 61.2406048885366 60.4495711920077 60.3266832866363 61.2570154737728 62.6337471414641 63.0780370078538 61.7580709967293 59.3706242161022 57.5179278196940 57.0393778510580 57.1889985766611 56.6085302189004 54.8940694116574 52.9199891462161 51.7033153935281 51.2697618105267 50.7116096570925 49.1437735802971 46.4922730297776 43.5626311945412 41.6410741531182 42.1109435829211
拟合后我点击左上角的generate code生成代码如下
function [fitresult, gof] = createFit(x, yLibT1T5)
%CREATEFIT(X,YLIBT1T5)
% Create a fit.
%
% Data for 'untitled fit 1' fit:
% X Input : x
% Y Output: yLibT1T5
% Output:
% fitresult : a fit object representing the fit.
% gof : structure with goodness-of fit info.
%
% See also FIT, CFIT, SFIT.
% Auto-generated by MATLAB on 18-Jul-2016 14:33:13
%% Fit: 'untitled fit 1'.
[xData, yData] = prepareCurveData( x, yLibT1T5 );
% Set up fittype and options.
ft = fittype( 'gauss2' );
opts = fitoptions( 'Method', 'NonlinearLeastSquares' );
opts.Display = 'Off';
opts.Lower = [-Inf -Inf 0 -Inf -Inf 0];
opts.StartPoint = [86.2628835110249 1899 524.936488657887 64.1489525914324 2849 659.714158889315];
% Fit model to data.
[fitresult, gof] = fit( xData, yData, ft, opts );
% Plot fit with data.
figure( 'Name', 'untitled fit 1' );
h = plot( fitresult, xData, yData );
legend( h, 'yLibT1T5 vs. x', 'untitled fit 1', 'Location', 'NorthEast' );
% Label axes
xlabel x
ylabel yLibT1T5
grid on
我想问下哪位大神知道这个蓝色标注的startpoint是按照什么方法默认生成的?小弟十二分感谢!!!!!!!! |