MATLAB doesn't recognize the function optimoptions
20 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(2 个)
Star Strider
2025-1-26
MATLAB is case-sensitive.
Try this —
options = optimoptions('ga')
.
.
7 个评论
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
.
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
2025-1-26
If really necessary you could use the older gaoptimset (which has not been recommended since R2018b)
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!