【发布时间】:2022-01-13 16:36:15
【问题描述】:
我想拟合某个曲线。我的数据存储在“x”和“y2”中。为了拟合这条曲线,有一些预定义的函数,比如“fit”。
我的例子:
x = [20 30 40 50 60 70 80 90 100 200];
y = [4.229 2.514 1.714 1.143 0.8 0.629 0.514 0.4 0.349 0.057];
p_0 = 2*10^(-5);
y2 = 10.^(y/20)*p_0;
[xData,yData] = prepareCurveData(x,y2);
fit_type = 'pchipinterp';
[fitresult] = fit(xData,yData,ft);
结果“fitresult”现在作为“1x1 cfit”对象存储在 MATLAB 工作区中。 有什么方法可以从 fitresult 中获取一个我可以手动定义的数组长度的实际数组? (例如 MATLAB 工作区:fitresult: 1x3841 double)
【问题讨论】:
标签: arrays matlab curve-fitting curve data-fitting