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
https://blog.csdn.net/misayaaaaa/article/details/71156256
https://blog.csdn.net/wendingzhulu/article/details/43062845
http://www.javaxxz.com/thread-366786-1-1.html
%fittype function
%for Y=wm1.*N./power(1+a1*N,b1);
%when 0
lsqcurvefit纵轴最佳拟合的范围在0到100(绝对值),实际拟合情况还需要根据数据特点来定,但是比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
%首先制造一些假数据,用来检验函数的可行性;
%当然也可以直接把真实数据赋值给N、Y两个变量.
wm1=50,a1=2,b1=2; %函数中的三个参数.
N=1:100;
Y=wm1*N./power(1+a1*N,b1)+rand(size(N)); %待检验的函数;并加入均匀分布的噪声
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)
%lsqnonlin function
wm1=10,a1=1,b1=0.9;
N=1:100;
Y=wm1*N./power(1+a1*N,b1)+rand(size(N));
scatter(N,Y)
hold on;
fun=@(a)a(1)*N./power(1+a(2)*N,a(3))-Y;
x0=[1,1,1];
a=lsqnonlin(fun,x0)
f2=a(1)*N./power(1+a(2)*N,a(3));
plot(N,f2)