|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
clear, clc
x=linspace(0.7,11.9,17);
y=[0.4894,0.1913,0.0850,0.0612,0.0463,0.0362,0.0259,0.02,0.0146,0.0101,0.0077,0.0041,0.0035,0.0019,0.0012,0.0006415,0.000285,];
%%17个数据拟合曲线
for i=0:0.001:1
kk=i;
fun=strcat('',num2str(kk),'.*a(1).*a(2).^(-a(1)).*x.^(a(1)-1).*exp(-(x./a(2)).^a(1))+(1-',num2str(kk),').*1/sqrt(2*pi)./a(3).*exp(-1.*(x-a(4)).^2/2./(a(3)^2))');
%%%韦伯分布和正态分布的加权拟合,前面权重i,后面权重1-i,限定i在 0-1之间计算1001次得到其他四个未知数的解
a=nlinfit(x,y,inline(fun),[0.5 1 0.5 1]);
I=1000*i+1
B(I,:)=a%%%B有1001行收集的数据
end
错误使用 nlinfit (line 199)
Error evaluating inline model function.
原因:
错误使用 inline/subsref (line 14)
内联函数的输入数目太多。
求教,万分感谢。。。
|
|