Enumeration error after 2023a update

2 次查看(过去 30 天)
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!

采纳的回答

Ogul Can Yurdakul
Ogul Can Yurdakul 2023-3-21
移动:the cyclist 2023-3-21
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 个评论
Adam Danz
Adam Danz 2023-3-21
编辑:Adam Danz 2023-8-16
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.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

产品


版本

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by