https://nl.mathworks.com/help/simulink/slref/bdisloaded.html
bdIsLoaded - Determine whether model, subsystem, or library is loaded - MATLAB
This MATLAB function returns whether the specified model, subsystem, or library is loaded.
determinewhethermodelsubsystemlibrary