temp(i,1) = rand(1)*(pb(1,num).pos(i,1) - pw(1,num).pos(i,1));
This line gives the following error:
Error using ==> minus
Not enough input arguments.
The following are the definitions of pb
and pw
.
pw=struct('fitness',[],'pos',{});
pb=struct('fitness',[],'pos',{});
pos
is a 2 x 1 array.