clear all;
clc;
%%Phase 2
LB = [0 0];
UB = [2 2];
m = 2; % no. of variables
n = 500; %Swarm size
wmax = 0.9; %max inertia weight
wmin = 0.4; %min inertia weight
c1 = 2.05; %acceleration factor
c2 = 2.05; % same
Maxiter = 100; % max no. of iteration
%%Phase 3
for i=1:n
for j=1:m
pos(i,j)= LB(i,j)+rand().*(UB(i,j)-LB(i,j)); %% error is occuring at this line.
end
end
vel = 0.1.*pos;
Best Answer