error when call fun.

2 次查看(过去 30 天)
huda nawaf
huda nawaf 2011-12-19
hi, I have this function: function [swarm]=initSwarm(N, N_PAR)
swarm = zeros(N,N_PAR);
for i = 1: N
for j = 1: N_PAR
swarm(i,j) = rand(1,1)%* ( V_MAX(j)-V_MIN(j) ) + V_MIN(j);
end
end
when call it:
x=initSwarm(5,5);
I get this error, I don't know why?
??? Undefined function or method 'initSwarm' for input arguments of type 'double'.

采纳的回答

Aurelien Queffurust
Aurelien Queffurust 2011-12-19
Just add initSwarm.m in your MATLAB path and it will work.

更多回答(1 个)

Grzegorz Knor
Grzegorz Knor 2011-12-19

类别

Help CenterFile Exchange 中查找有关 Particle Swarm 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by