How to adjust dimension in xx

5 次查看(过去 30 天)
jazba hafeez
jazba hafeez 2022-3-22
回答: KSSV 2022-3-22
function f = watch2(b,x,M,n,lb,ub,costfun)
xx=zeros(M,n);
for i=1:M
for j=1:n
xx(i,:)= (x(i,j) - b)+ ((x(i,j) + b)-(x(i,j)-b)).*rand;
end
end
xx;
if ob(xx)<ob(x)
x(i,:)=xx(i,:);
end %fw=xx
f=lb+(ub-lb).*x;
end

回答(1 个)

KSSV
KSSV 2022-3-22
for i=1:M
for j=1:n
xx(i,j)= (x(i,j) - b)+ ((x(i,j) + b)-(x(i,j)-b)).*rand;
end
end

类别

Help CenterFile Exchange 中查找有关 Programming 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by