先确认几件事
1. elseif k~=0&&l~=0
temp=min(b2,max(a1,b1));
T1=normcdf(temp,0,1);
temp=max(b1,max(a2,b2)); OR temp=max(b1,min(a2,b2));
2.a1=(k-i-0.5)*w*(log(1+250*(m+l*q)^2+2.332.....
a2=(k-i+0.5)*w*(log(1+250*(m+l*q)^2+2.332.....
250如何定的
这会影响结果
3.我先把probability matrix
放进,你可试试
m1=17;
m2=25;
R=zeros(m1*m2,m1*m2);
for i=0:1:m1-1
for j=0:1:m2-1
for k=0:1:m1-1
for l=0:1:m2-1
a1=(k-i-0.5)*w*(log(1+250*(m+l*q)^2+2.332*(m+l*q)/2)/(m+l*q)-1.166)+(m+l*q)/2;
a2=(k-i+0.5)*w*(log(1+250*(m+l*q)^2+2.332*(m+l*q)/2)/(m+l*q)-1.166)+(m+l*q)/2;
b1=(m+(l-0.5)*q-(1-p)*(m+j*q))/p;
b2=(m+(l+0.5)*q-(1-p)*(m+j*q))/p;
if k==0&&l==0
temp=min(a2,b2);
T=normcdf(temp,0,1);
R(i*m2+(j+1),k*m2+(l+1))=
elseif k==0&&l~=0
temp=b1;
T1=normcdf(temp,0,1);
temp=max(b1,min(a2,b2));
T2=normcdf(temp,0,1);
R(i*m2+(j+1),k*m2+(l+1))=
elseif k~=0&&l==0
temp=a1;
T1=normcdf(temp,0,1);
temp=max(a1,min(a2,b2));
T2=normcdf(temp,0,1);
R(i*m2+(j+1),k*m2+(l+1))=
elseif k~=0&&l~=0
temp=min(b2,max(a1,b1));
T1=normcdf(temp,0,1);
temp=max(b1,min(a2,b2));
T2=normcdf(temp,0,1);
R(i*m2+(j+1),k*m2+(l+1))=
end; %end if
end;
end;
end;
end;