用了polyfit:多项式模型
fittype+fit:自定义函数
f=fittype('(函数)','independent','(自变量)','coefficient','未知参数');
cfun=fit(x,y,f);
eg: f1=fittype('a*x+b','independent','x','coefficients',{'a','b'});
fun= fit(x1,y1,f1);
其他可参考:
用了polyfit:多项式模型
fittype+fit:自定义函数
f=fittype('(函数)','independent','(自变量)','coefficient','未知参数');
cfun=fit(x,y,f);
eg: f1=fittype('a*x+b','independent','x','coefficients',{'a','b'});
fun= fit(x1,y1,f1);
其他可参考: