How to adjust dimension in xx
5 views (last 30 days)
Show older comments
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
0 Comments
Answers (1)
KSSV
on 22 Mar 2022
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
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!