フィルターのクリア

Enumeration error after 2023a update

2 ビュー (過去 30 日間)
Ogul Can Yurdakul
Ogul Can Yurdakul 2023 年 3 月 21 日
編集済み: Adam Danz 2023 年 8 月 16 日
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 Center および File ExchangeStartup and Shutdown についてさらに検索

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by