particleswarm optimization in MATLAB

dear all i have an problem if any one can help me
when i used any example of particle swarm optimization , this example from help of particle swarm
fcn = @dejong5fcn;
nvars = 2;
lb = [-64 -64];
ub = [64 64];
[x,fval] = particleswarm(fcn,nvars,lb,ub)
it gives me this error i do not know why even though i have the particle swarm toolbox
Undefined function 'particleswarm' for input arguments of type 'function_handle'.
thank you

3 comentarios

Ced
Ced el 14 de Mzo. de 2016
Editada: Ced el 14 de Mzo. de 2016
Which version of matlab are you using? They are part of the "Global Optimization Toolbox", but were only added in 2014b.
Your code runs without errors for me.
jgg
jgg el 14 de Mzo. de 2016
You also need to actually have the toolbox installed and as part of your license. The ver command should list your available toolboxes.
mohammed hussein
mohammed hussein el 14 de Mzo. de 2016
Thank you for answering Iam using MATALB 2015b full with optimization toolbox

Iniciar sesión para comentar.

 Respuesta aceptada

Walter Roberson
Walter Roberson el 14 de Mzo. de 2016

0 votos

particleswarm() is part of the Global Optimization Toolbox, not part of the Optimization Toolbox.

4 comentarios

mohammed hussein
mohammed hussein el 14 de Mzo. de 2016
Thank you for answering Yes i have global optimization toolbox.also It was working before less than one month but today when I check it it doesn't work I don't know why
What do you get for
which -all particleswarm
mohammed hussein
mohammed hussein el 15 de Mzo. de 2016
Editada: Walter Roberson el 15 de Mzo. de 2016
it gives me
>> which -all particleswarm
C:\Program Files\MATLAB\R2015b\toolbox\globaloptim\globaloptim\particleswarm.m % Has no license available
but it was working before so why there is no license available
thank you very much for your helping
Walter Roberson
Walter Roberson el 15 de Mzo. de 2016
Were you using a Trial version? If so it might have expired.
Were you using a Student Version license obtained through a MOOC (Massive Open Online Course) ? If so then it might have expired.
Were you using a Student Version license under one of the Term options such as "9 months" or "1 year" ? If so then it might have expired.

Iniciar sesión para comentar.

Más respuestas (0)

Preguntada:

el 14 de Mzo. de 2016

Comentada:

el 15 de Mzo. de 2016

Community Treasure Hunt

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

Start Hunting!

Translated by