How do I find libraries with unsaved changes?

5 Ansichten (letzte 30 Tage)
Paul
Paul am 19 Aug. 2024
Bearbeitet: akshatsood am 19 Aug. 2024
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.

Antworten (1)

akshatsood
akshatsood am 19 Aug. 2024
Bearbeitet: akshatsood am 19 Aug. 2024
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.

Kategorien

Mehr zu Programmatic Model Editing finden Sie in Help Center und File Exchange

Tags

Produkte


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by