matlab程序结果不对p1=0.7;p2=0.3;b1=1;b2=2;b3=3;b4=4;director=[16 13 12 10 9]; %领导score=[]; %得分kong=logical(ones(1,15));for i=1:5for j=1:director(i) %领导投票random1=randperm(3);for n=1:3score(sum(director(1:i-1))+j,(i-1)*3+n) =rando
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/14 11:50:23
matlab程序结果不对p1=0.7;p2=0.3;b1=1;b2=2;b3=3;b4=4;director=[16 13 12 10 9]; %领导score=[]; %得分kong=logical(ones(1,15));for i=1:5for j=1:director(i) %领导投票random1=randperm(3);for n=1:3score(sum(director(1:i-1))+j,(i-1)*3+n) =rando
matlab程序结果不对
p1=0.7;p2=0.3;b1=1;b2=2;b3=3;b4=4;
director=[16 13 12 10 9]; %领导
score=[]; %得分
kong=logical(ones(1,15));
for i=1:5
for j=1:director(i) %领导投票
random1=randperm(3);
for n=1:3
score(sum(director(1:i-1))+j,(i-1)*3+n) =random1(n);
end
kong(1,(i-1)*3+1:(i-1)*3+3)=0;score(sum(director(1:i-1))+j,kong)=b4;kong(:)=1;
score(sum(director(1:i-1))+j,(i-1)*3+find(random1==30))=b3*p1+b4*p2;
temp=randperm(15);a=(i-1)*3+1:i*3;temp(ismember(temp,a))=[];
score(sum(director(1:i-1))+j,temp(1))=b4*p1+b3*p2;
end
end
软件的运算结果是矩阵 1
但实际上是想让它输出一个大的矩阵
matlab程序结果不对p1=0.7;p2=0.3;b1=1;b2=2;b3=3;b4=4;director=[16 13 12 10 9]; %领导score=[]; %得分kong=logical(ones(1,15));for i=1:5for j=1:director(i) %领导投票random1=randperm(3);for n=1:3score(sum(director(1:i-1))+j,(i-1)*3+n) =rando
个人认为这个问题可以问百度.