MATLAB doesn't recognize the function optimoptions

조회 수: 20 (최근 30일)
Julio
Julio 2025년 1월 26일
댓글: Walter Roberson 2025년 1월 26일
I'm getting an error at the following line:
options = optimoptions('ga','PopulationSize',10,'MaxGenerations',10);
The following message exemplifies the problem.
I'm using the version 9.10 (R2021a) of MATLAB and the version 4.5 (R2021a) of the Global Optimization Toolbox
The photo is just an exemple, I must say that the version written in lowercase also doesn't work
Any suggestions will be appreciated

답변 (2개)

Star Strider
Star Strider 2025년 1월 26일
MATLAB is case-sensitive.
Try this —
options = optimoptions('ga')
optionbs =
ga options: Set properties: No options set. Default properties: ConstraintTolerance: 1.0000e-03 CreationFcn: [] CrossoverFcn: [] CrossoverFraction: 0.8000 Display: 'final' EliteCount: '0.05*PopulationSize' FitnessLimit: -Inf FitnessScalingFcn: @fitscalingrank FunctionTolerance: 1.0000e-06 HybridFcn: [] InitialPopulationMatrix: [] InitialPopulationRange: [] InitialScoresMatrix: [] MaxGenerations: '100*numberOfVariables' MaxStallGenerations: 50 MaxStallTime: Inf MaxTime: Inf MutationFcn: [] NonlinearConstraintAlgorithm: 'auglag' OutputFcn: [] PlotFcn: [] PopulationSize: '50 when numberOfVariables <= 5, else 200' PopulationType: 'doubleVector' SelectionFcn: [] UseParallel: 0 UseVectorized: 0
.
.
  댓글 수: 7
Star Strider
Star Strider 2025년 1월 26일
Do you have the Optimization Toolbox and the Global Optimizaztion Toolbox licensed and installed?
If you do (since it is still not working) run these from your Command Window or a scriptt:
restoredefaultpath
rehash toolboxcache
and try it again. If it is still not working after that, Contact Support.
.
Walter Roberson
Walter Roberson 2025년 1월 26일
If the message is about optimoptions not being recognized, then you do not have the Optimization Toolbox installed, and certainly not the Global Optimization Toolbox.

댓글을 달려면 로그인하십시오.


Walter Roberson
Walter Roberson 2025년 1월 26일
If really necessary you could use the older gaoptimset (which has not been recommended since R2018b)

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by