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 CenterFile Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기

태그

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by