How to adjust dimension in xx

5 views (last 30 days)
jazba hafeez
jazba hafeez on 22 Mar 2022
Answered: KSSV on 22 Mar 2022
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

Answers (1)

KSSV
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

Categories

Find more on Programming in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!