How do I find libraries with unsaved changes?

5 ビュー (過去 30 日間)
Paul
Paul 2024 年 8 月 19 日
編集済み: akshatsood 2024 年 8 月 19 日
I'm trying to build code via rtwbuild and am being met with the error Selected subsystem is linked to a library with unsaved changes. Please save the library.
I've been manually looking through the model and can't see anything with unsaved changes or broken links. And there seems to be no easy way to find the library with unsaved changes in question. Am I missing something or is there a way to find these libraries? I'm working with a very big model.

回答 (1 件)

akshatsood
akshatsood 2024 年 8 月 19 日
編集済み: akshatsood 2024 年 8 月 19 日
Dear @Paul,
I understand that you are trying to locate libraries with unsaved changes. Here are some steps you can take:
Use the Model Explorer
  • Open the Model Explorer (View > Model Explorer).
  • In the Model Explorer, you can see all the libraries and models loaded in your session. Look for any libraries that have an asterisk (*) next to their name, which indicates unsaved changes.
Check the MATLAB Command Window
  • Sometimes, warnings or messages about unsaved changes are displayed in the MATLAB Command Window. Review the messages for any hints about which library might need saving.
Programmatically Check for Unsaved Changes
  • You can write a MATLAB script to iterate over all loaded libraries and check for unsaved changes.
loadedModels = find_system('type', 'block_diagram');
% check for unsaved changes
for i = 1:length(loadedModels)
modelName = loadedModels{i};
if bdIsLibrary(modelName)
if strcmp(get_param(modelName, 'Dirty'), 'on')
fprintf('Library with unsaved changes: %s\n', modelName);
end
end
end
I hope this helps.

カテゴリ

Help Center および File ExchangeProgrammatic Model Editing についてさらに検索

タグ

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by