Hi,
I would like to start from this program which works well when it is a 1 * 2 initialization to a 2 * 2 initialization which I will then put the program which is wrong.
clearclcif nargin<1,% Number of agents (or different solutions)
n=10;end % list of paramters
m_k=0; lp1=0.7;lp2=0.5; bg=0;w_k=0; N_IterTotal=2000;nd=2; %% Simple bounds of the search domain
%bea function
% [ x , y ]
Lb= [-4.5, -4.5];% Lower bounds
Ub= [4.5, 4.5];% Upper bounds
sum =0; for t=1:1; size(Lb);% Random initial solutions
%%%%%disp('agent(i,:) bp_k(i)');
for i=1:n,agent(i,:)=Lb+(Ub-Lb).*rand(size(Lb))w_array(i,:)= agent(i,:);bp_k(i,:)= agent(i,:); disp(strcat(num2str(agent(i,:)))); end
This is wrong code that i want help.
clearclcif nargin<1,% Number of agents (or different solutions)n=10;end % list of paramters m_k=0; lp1=0.7;lp2=0.5; bg=0;w_k=0; N_IterTotal=2000;nd=2; %% Simple bounds of the search domain%bea function% [ x , y, z ]
Lb=[36.5*ones(n,1),50*ones(n,1),0.73*ones(n,1)];%% Lower bounds
Ub=[41.5*ones(n,1),396*ones(n,1),0.94*ones(n,1)];% Upper boundssum =0; for t=1:1; size(Lb);% Random initial solutions%%%%%disp('agent(i,:) bp_k(i)');for i=1:n,agent(i,:)=Lb+(Ub-Lb).*rand(size(Lb))%%%%le problème réside ici sur la déclaration de cette ligne de commande
w_array(i,:)= agent(i,:);bp_k(i,:)= agent(i,:); disp(strcat(num2str(agent(i,:)))); end
Please help me to write well the command line agent(i,:)=Lb+(Ub-Lb).*rand(size(Lb)) to initialize it at vectors 2*2 with Lb and Ub.
Best Answer