MATLAB: Do I receive a warning when I use FIND_SYSTEM in the model’s PreLoadFcn callback in Simulink 6.1 (R14SP1)

callbackfind_systemloadpre-loadrecursivelyrecusivesimulinkwarning

I use the FIND_SYSTEM function in the PreLoadFcn callback for one of my Simulink models. When I open the model, Simulink displays the following warning:
Warning: Attempt to load model file 'model' recursively.

Best Answer

This change has been incorporated into the documentation in Release 2009b (R2009b). For previous releases, read below for any additional information:
By default, the FIND_SYSTEM function attempts to load any partially loaded models. When the PreLoadFcn callback invokes FIND_SYSTEM, FIND_SYSTEM tries to load the calling model, causing the recursion warning.
To prevent this warning, disable the model loading property of FIND_SYSTEM by turning off the 'LoadFullyIfNeeded' property. To do this, include 'LoadFullyIfNeeded' and 'off' as the first two arguments of the call to FIND_SYSTEM as shown below:
find_system(gcs,'LoadFullyIfNeeded','off','PropertyName','PropertyValue')