Options in Genetic Algorithm don't work
조회 수: 30 (최근 30일)
이전 댓글 표시
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?
댓글 수: 0
답변 (4개)
Ahmad Rizqullah Abdul Malek
2020년 3월 2일
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
rwan abdallah
2022년 4월 11일
Hello, the toolbox is already installed, however , I'm still getting the same error
Suraj Mankulangara
2018년 2월 22일
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.
댓글 수: 0
Israel Vargas-Cruz
2020년 4월 2일
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);
댓글 수: 0
Kevy Pontes
2021년 1월 20일
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
NN
2022년 10월 27일
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.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!