Options in Genetic Algorithm don't work

71 visualizaciones (últimos 30 días)
Luigi Treccozzi
Luigi Treccozzi el 10 de Feb. de 2018
Comentada: NN el 27 de Oct. de 2022
When I try to run this code: options = optimoptions('ga','CrossoverFcn',@mycrossover); Matlab gives me this Error: Error using optimoptions (line 124) Invalid solver specified. Provide a solver name or handle (such as 'fmincon' or @fminunc). Type DOC OPTIMOPTIONS for a list of solvers.
I have no idea what that means. Please help. How do I set options parameters?

Respuestas (4)

Ahmad Rizqullah Abdul Malek
Ahmad Rizqullah Abdul Malek el 2 de Mzo. de 2020
I got this exact error too running someone else's code. The code could finally run after I installed "Global Optimization Toolbox" as an add-on for Matlab.
Go on the "Apps" tab on Matlab > "Get More Apps" > Search for "Global Optimization Toolbox" (make sure you Clear Filter first) > Install it
Run the code and it should work aye.
  2 comentarios
Shresth Somya
Shresth Somya el 21 de Jul. de 2021
Thanks. It worked for me.
rwan abdallah
rwan abdallah el 11 de Abr. de 2022
Hello, the toolbox is already installed, however , I'm still getting the same error

Iniciar sesión para comentar.


Suraj Mankulangara
Suraj Mankulangara el 22 de Feb. de 2018
Hello Luigi
The optimoptions() function is part of the Optimization Toolbox, which is different from the Global Optimization Toolbox, (which provides the genetic algorithm solver) in MATLAB (you can refer to the top left corner in the doc links below to see which toolbox a function belongs to):
It is likely that this error occurs because you don't have either of the toolboxes installed.
To check which toolboxes are installed in your MATLAB, type
ver
at the MATLAB command window.

Israel Vargas-Cruz
Israel Vargas-Cruz el 2 de Abr. de 2020
Error using optimoptions (line 124)
Invalid solver specified. Provide a solver name or handle (such as 'fmincon' or @fminunc).
Type DOC OPTIMOPTIONS for a list of solvers.
Error in Genetic_Optimization (line 6)
options =
optimoptions('ga','PopulationSize',100,'Display','iter','UseParallel',true,'MaxStallGenerations',10,'PlotFcn',
@gaplotbestf);

Kevy Pontes
Kevy Pontes el 20 de En. de 2021
Hello,
I've got the same error for Genetic algorithm [Error: Error using optimoptions (line 124) Invalid solver specified. Provide a solver name or handle (such as 'fmincon' or @fminunc). Type DOC OPTIMOPTIONS for a list of solvers.] with the following toolboxes installed:
MATLAB Version 8.5 (R2015a)
Simulink Version 8.5 (R2015a)
Control System Toolbox Version 9.9 (R2015a)
Data Acquisition Toolbox Version 3.7 (R2015a)
Fixed-Point Designer Version 5.0 (R2015a)
Fuzzy Logic Toolbox Version 2.2.21 (R2015a)
Global Optimization Toolbox Version 3.3.1 (R2015a)
Image Acquisition Toolbox Version 4.9 (R2015a)
Image Processing Toolbox Version 9.2 (R2015a)
Instrument Control Toolbox Version 3.7 (R2015a)
Neural Network Toolbox Version 8.3 (R2015a)
Optimization Toolbox Version 7.2 (R2015a)
Partial Differential Equation Toolbox Version 2.0 (R2015a)
Signal Processing Toolbox Version 7.0 (R2015a)
SimPowerSystems Version 6.3 (R2015a)
Simscape Version 3.13 (R2015a)
Statistics and Machine Learning Toolbox Version 10.0 (R2015a)
Symbolic Math Toolbox Version 6.2 (R2015a)
System Identification Toolbox Version 9.2 (R2015a)
Wavelet Toolbox Version 4.14.1 (R2015a)
Any guesses???
Thanks
  3 comentarios
Kevy Pontes
Kevy Pontes el 22 de En. de 2021
Thanks, Alan.
It worked with gaoptimset.
Regards
NN
NN el 27 de Oct. de 2022
Hi Kevy,
Please look at below code and suggest how i can modify it
options = optimoptions("ga",prob.optimoptions,"Display","iter");
[values,fval,exitflag] = solve(prob,"Solver","ga","Options",options)
i am getting the error
The value of 'Solver' is invalid. 'ga' is not a valid solver.

Iniciar sesión para comentar.

Categorías

Más información sobre Introduction to Installation and Licensing en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by