- cftool工具箱主要是針對數據擬合的。使用起來特別的強大,尤其對於數據的處理超級方便,可以直接對於數據擬合,並且可以預設各種的擬合方案。這裏注意的是非線性的也可以進行擬合,例如:冪律,高斯等等。
https://jingyan.baidu.com/article/6f2f55a16aba04b5b93e6cca.html
https://blog.csdn.net/rayna00/article/details/45060237
https://www.cnblogs.com/tensory/p/6590779.html
http://blog.sina.com.cn/s/blog_4d4afb6d0100t37n.html
- polyfit(x,y,n)。用多項式求過已知點的表達式,其中x爲源數據點對應的橫座標,可爲行向量、矩陣,y爲源數據點對應的縱座標,可爲行向量、矩陣,n爲你要擬合的階數,一階直線擬合,二階拋物線擬合,並非階次越高越好,看擬合情況而定。
https://blog.csdn.net/misayaaaaa/article/details/71156256
https://blog.csdn.net/wendingzhulu/article/details/43062845
- fittype。
http://www.javaxxz.com/thread-366786-1-1.html
%fittype function
%for Y=wm1.*N./power(1+a1*N,b1);
%when 0<ab-a<1,there's a peak,up first and down secondly;
%when 1<ab-a,all down;
%when ab-a<0,all up.
wm1=5,a1=2,b1=1.1;
N = linspace(1,100);
Y = wm1.*N./power(1+a1*N,b1);
plot(N,Y)
myfittype = fittype('wm.*N./power(1+a*N,b)','dependent',{'Y'},'independent',{'N'},...
'coefficients',{'wm','a','b'});
myfit = fit(N',Y',myfittype)
a=myfit.a
b=myfit.b
wm=myfit.wm
plot(myfit,N,Y)
- 非線性擬合lsqcurvefit、nlinfit、lsqnonlin
https://www.cnblogs.com/Juli016/articles/5211239.html
https://blog.csdn.net/u014356002/article/details/70242501
https://blog.csdn.net/huahua19891221/article/details/81841220
%lsqcurvefit function
wm1=50,a1=2,b1=2;
N=1:100;
Y=wm1.*N./power(1+a1*N,b1);
scatter(N,Y)
hold on;
a=[1 2 3];
f=@(a,x)a(1)*x./power(1+a(2)*x,a(3))
a=lsqcurvefit(f,a,N,Y)
x=1:100;
f2=a(1)*x./power(1+a(2)*x,a(3))
plot(f2)