matlab拟合对数函数时总是出错

x=[30 31.1 32.8 33.3 34.4 42.8 50.6 35 31.1 37.8];
y=[51.9 51.6 52.5 57.6 44.7 41.2 36.8 54.7 51.3 49 ];
f = fittype('a*log(x)+b'); % 拟合函数的形式

fit1 = fit(x',y',f,'StartPoint',[x(1) y(1)]);
a = fit1.a; % a的值
b = fit1.b; % b的值
fdata = feval(fit1,x'); % 用拟合函数来计算y
figure

plot(x,y); hold on
plot(x,fdata','r'); hold off
legend('Ori data',' Fitting data');
错误使用 fit>iFit (line 353)
BLAS loading error:
D:\bin\win32\atlas_Athlon.dll: 找不到指定的模块。
出错 fit (line 108)

[fitobj, goodness, output, convmsg] = iFit( xdatain, ydatain, fittypeobj, ...
出错 Untitled (line 5)

fit1 = fit(x',y',f,'StartPoint',[x(1) y(1)]);
请问哪里有问题?

应该先输入数据 x=[] y=[] 接着输入cftool matlab的数据拟合工具箱吧 界面的你看下 里面首先是导入xy数据 接着就可以自定义拟合函数了 你试试看,应该是可以的
温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答