Unable to close or recreate a dictionary because it is already open, but it's actually not...
13 ビュー (過去 30 日間)
古いコメントを表示
Error using myScript
Unable to create or open data dictionary
'C:\temp\my_dict.sldd'
because another dictionary with the same file name is already open. To create or open this dictionary, close all
open dictionaries by calling 'Simulink.data.dictionary.closeAll' and reopen.
Open file:
'C:\temp\my_dict.sldd'
However >> Simulink.data.dictionary.getOpenDictionaryPaths does not show the complained file and eventually because of that
>> Simulink.data.dictionary.closeAll('my_dict.sldd', '-discard') does not seem to have any effect or or at least does not solve the problem.
Why is the dictionary Matlab is complaining about not shown in the list of open dictionaries?
And how can I fix this?
>> Simulink.data.dictionary.closeAll('-discard') to wipe all works but is not an option because this would lead to failures in the following processes because of the dictionaries that are also closed but are still needed...
p.s. the old dictionary has already been wiped from the disk at the point of the test which also cannot be revoked or changed.
0 件のコメント
回答 (1 件)
Vinay
2025 年 6 月 18 日
To delete the Simulink data dictionary, run the following commands in the MATLAB Command Window:
clear my_dictDictObj; % Clear the dictionary object from the workspace
Simulink.data.dictionary.closeAll('my_dict.sldd','-discard');
delete('my_dict.sldd');
This ensures that "my_dict.sldd" is fully cleared from memory and a new dictionary can be created with the same name using
Simulink.data.dictionary.create('my_dict.sldd');
Hope this helps!
参考
カテゴリ
Help Center および File Exchange で Manage Design Data についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!