Mohammed, make sure that the PopInitRange, LB and UB variables that you set are the correct size. PopInitRange (which is set using psooptimset) should be a 2 x nvars matrix (that's two rows, and nvars columns). LB and UB should both be 1 x nvars, i.e. row vectors.
Hi Sam, this the error msg: I have tried several times to modify the dimensions but it doesnt work
Index exceeds matrix dimensions.
Error in psocheckpopulationinitrange (line 9)
index(~lowerInf) = LB(~lowerInf) ~= lowerRange(~lowerInf) ;
Error in pso (line 214)
options.PopInitRange = ...
Hi Sam, thanks for the nice job. just wanna ask you how can I modify the pso.m to handle a 24 unknown optimization problem?
I have tested your code through different test functions and different PSO parameters adjustments and it works fine, however, when I try high dimensional problem I always fail in matrix dimension and population range problem.
Could you please help me to cope with this issue?