刚用上matlab 看看这个错误是什么意思 还希望指正程序如下 想画一个f与u(正态函数x1的均值的函数关系)r=@(x2,x4)(1-2.62*(1-0.36*(x4/x2)^(-0.56))^1.5*(x4/x2)^1.16)p=@(x1,x2,x3,x5)(174.42*(x1/x5)*((x3/(x2-x1))^0.85)
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/17 02:26:15
刚用上matlab 看看这个错误是什么意思 还希望指正程序如下 想画一个f与u(正态函数x1的均值的函数关系)r=@(x2,x4)(1-2.62*(1-0.36*(x4/x2)^(-0.56))^1.5*(x4/x2)^1.16)p=@(x1,x2,x3,x5)(174.42*(x1/x5)*((x3/(x2-x1))^0.85)
刚用上matlab 看看这个错误是什么意思 还希望指正
程序如下 想画一个f与u(正态函数x1的均值的函数关系)
r=@(x2,x4)(1-2.62*(1-0.36*(x4/x2)^(-0.56))^1.5*(x4/x2)^1.16)
p=@(x1,x2,x3,x5)(174.42*(x1/x5)*((x3/(x2-x1))^0.85))
q=@(x6,x7)(x6*x7)
f=0;
p1=0;p2=0;
u=0.08:0.04/100:0.12;
for i=1:1:10000
x1=normrnd(u,0.00125);
x2=normrnd(0.3,0.005);
x3=normrnd(0.1,0.00125);
x4=normrnd(0.1,0.005);
x5=normrnd(1.5,0.075);
x6=normrnd(16,0.2667);
x7=normrnd(0.75,0.0125);
t=p(x1,x2,x3,x5)*(r(x2,x4)/q(x6,x7))^0.5;
if(t>=1.6&t<1.8)
f=f+0.1;
p1=p1+0.0001;
elseif(t>=1.8)
f=f+0.9;
p2=p2+0.0001;
end;
end;
>> plot(u,f)
刚用上matlab 看看这个错误是什么意思 还希望指正程序如下 想画一个f与u(正态函数x1的均值的函数关系)r=@(x2,x4)(1-2.62*(1-0.36*(x4/x2)^(-0.56))^1.5*(x4/x2)^1.16)p=@(x1,x2,x3,x5)(174.42*(x1/x5)*((x3/(x2-x1))^0.85)
lz 看你再等答案,你需要的图是不是这个意思?
clear
r=@(x)(1-2.62*(1-0.36*(x(2)/x(1))^(-0.56))^1.5*(x(2)/x(1))^1.16);
p=@(x)(174.42*(x(1)/x(4))*((x(3)/(x(2)-x(1)))^0.85));
q=@(x)(x(1)*x(2));
p1=0;p2=0;
u=0.08:0.04/100:0.12;
F=zeros(1,length(u));
for i=1:1:101
f=0;%每次计算f清0
for j=1:1:10000
x1=normrnd(u(i),0.00125);
x2=normrnd(0.3,0.005);
x3=normrnd(0.1,0.00125);
x4=normrnd(0.1,0.005);
x5=normrnd(1.5,0.075);
x6=normrnd(16,0.2667);
x7=normrnd(0.75,0.0125);
xr=[x2,x4];
xp=[x1,x2,x3,x5];
xq=[x6,x7];
t=p(xp)*(r(xr)/q(xq))^0.5;
if(t>=1.6&&t<1.8)
f=f+0.1;
p1=p1+0.0001;
elseif(t>=1.8)
f=f+0.9;
p2=p2+0.0001;
end
end
F(i)=f;
end
plot(u,F)