请大神帮忙看一下具体咋回事?
错误使用 arrayfun
Uniform 输出中存在非标量值(在索引 1 处,输出 1)。
请将 'UniformOutput' 设置为 false。
function [x,f]=DuoGongNeng
P=[320;170;60;200;230;260;80;80;240;70;220;220;120;240;440;420;90;270;210];
Rmin=0.8;
Rmax=0.9999;
W=[0.52;0.39;0.32;0.2;0.35];
S=120;
pc=0.9;
G=500;
pm=0.01;
x=zeros(G,19);
Rs=zeros(G,1);
f=zeros(G,1);
theta=zeros(S,19);
theta=unifrnd(0.8,0.9999,S,19);
T=0;
D=zeros(S,1);
g=zeros(S,19);
gg=zeros(5,1);
fit=@(p)(0.5+2*(S-p)/(S-1));
for r=1:500
Cs=zeros(S,1);
for i=1:S
for j=1:19
T=T+P(j)*exp(theta(i,j)/Rmin-1);
g(i,j)=exp(theta(i,j)-1);
end