Enumeration error after 2023a update

7 vues (au cours des 30 derniers jours)
Ogul Can Yurdakul
Ogul Can Yurdakul le 21 Mar 2023
Modifié(e) : Adam Danz le 16 Août 2023
I started getting the following error after I upgraded to 2023a:
Warning: Executing startup failed in matlabrc.
This indicates a potentially serious problem in your MATLAB setup, which should be resolved as soon as possible. Error detected was:
MATLAB:datatypes:InvalidEnumValueFor
Invalid enum value. Use one of these values: 'auto' | 'manual'.
Thank you in advance!

Réponses (1)

Ogul Can Yurdakul
Ogul Can Yurdakul le 21 Mar 2023
Déplacé(e) : the cyclist le 21 Mar 2023
Fixed it. In my startup.m file, I set all LineWidth values to 1 in a for loop as follows:
lineWidth_list_factory = fieldnames(get(groot,'factory'));
index_lineWidth = find(contains(lineWidth_list_factory,'LineWidth'));
for i = 1:length(index_lineWidth)
default_name = strrep(lineWidth_list_factory{index_lineWidth(i)},'factory','default');
set(groot, default_name, 1);
end
Apparently a new property called defaultAxesGridLineWidthMode is added to the relevant list, and its value is either 'manual' or 'auto'. I fixed the issue with a simple if statement:
lineWidth_list_factory = fieldnames(get(groot,'factory'));
index_lineWidth = find(contains(lineWidth_list_factory,'LineWidth'));
for i = 1:length(index_lineWidth)
default_name = strrep(lineWidth_list_factory{index_lineWidth(i)},'factory','default');
if ~contains(default_name,'Mode')
set(groot, default_name, 1);
end
end
And the problem is fixed.
  1 commentaire
Adam Danz
Adam Danz le 21 Mar 2023
Modifié(e) : Adam Danz le 16 Août 2023
Alternatively, to avoid the defaultAxesGridLineWidthMode, you could use endsWith instead of contains.
index_lineWidth = find(endsWith(lineWidth_list_factory,'LineWidth'));
A full implementation of this solution was shared in this thread.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Startup and Shutdown dans Help Center et File Exchange

Produits


Version

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by