Effacer les filtres
Effacer les filtres

Optimoptions error: "Empty keys are not allowed in this container" (no number given)

34 vues (au cours des 30 derniers jours)
Geoffrey Rivers
Geoffrey Rivers le 25 Mar 2020
Commenté : Arash Allahyari le 11 Fév 2022
What is the source of my error? I am running a program that calls optimoptions with the following command:
options = optimoptions(@fmincon,'Algorithm','sqp');
This results in the following errors:
Error using optimoptions (line 124)
Empty keys are not allowed in this container.
Error in Cure_main (line 36)
options = optimoptions(@fmincon,'Algorithm','sqp');
Cure_main.m is my main function. Prior to line 36, no other functions are yet called. Other members of my team can run the code, using copies of my files. They are using 2018a, I am using a newly installed copy of 2020a. I have confirmed that I can open optimoptions in my copy of matlab.
I have also checked that I have the appropriate toolbox:
>> license('inuse')
matlab
optimization_toolbox
I have not changed the path for anything in my matlab, other than adding the directory of my script files and the .txt that they use. I have tried changing @fmincon to 'fmincon', and had the same result.
The complete code is:
clc; clear all; close all;
format long;
global Atest T m;
d=load('1.txt');
m=1580;
Atest=d(:,2)*1.0;
T=d(:,1);
x=[
0.0106777326336
];
% I have removed a large number of commented-out value options here
options = optimoptions(@fmincon,'Algorithm','sqp');
There is more after this, but it is not necessary to reproduce the error.
  18 commentaires
Walter Roberson
Walter Roberson le 1 Mai 2020
Please run the following commands and show us the output
matlabroot
info = meta.package.fromName('optim.options')
{info.FunctionList.Name}
These commands will not change anything on your system, but they will give us information that we need to go further in debugging the problem.
Francescogiuseppe Morabito
this is the output I get:
info = meta.package.fromName('optim.options')
{info.FunctionList.Name}
ans =
'C:\Program Files\MATLAB\R2020a'
info =
package with properties:
Name: 'optim.options'
Description: ''
DetailedDescription: ''
ClassList: [4×1 meta.class]
FunctionList: [10×1 meta.method]
PackageList: [1×1 meta.package]
ContainingPackage: [1×1 meta.package]
ans =
1×10 cell array
Columns 1 through 3
{'createSolverOpt…'} {'createLinkToSol…'} {'generateMultiAl…'}
Columns 4 through 6
{'replaceFinDiffR…'} {'getDefaultFinDi…'} {'getDisplayOptio…'}
Columns 7 through 9
{'getOptionDefaul…'} {'createNonConsta…'} {'generateMultiAl…'}
Column 10
{'generateSingleA…'}

Connectez-vous pour commenter.

Réponses (1)

Nick Zhi
Nick Zhi le 8 Mai 2020
I met the same problem with 2020a, I re-run the installer and added Global Optimization Toolbox into my installation procedure. It seems to have resolved the problem.
  4 commentaires
bd l
bd l le 17 Sep 2020
It works, thank you.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Introduction to Installation and Licensing dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by