MATLAB: How to prevent Simulink 7.4(R2009b) from showing parameterized link warnings when loading/saving the model

linkparameterizedsimulinksuppresswarning

I have a Simulink model, which contains intentional parameterized links. When I save or load my model the following warnings are shown in the MATLAB Command Window:
Warning: Block diagram 'mymodel' contains one or more parameterized library links. To find the parameterized links use
the Model Advisor. The diagram has been saved but may not behave as you intended.
Warning: "mymodel/myblock" is a parameterized link. To view, discard, or propagate the changes for this link, use the
"Link Options" menu item
In general\private\openmdl at 13
In open at 155
In uiopen at 196
As the parameterized links are intentional, I would like to know how I can suppress these warnings.

Best Answer

In order to avoid these warnings from being shown, you can use the MATLAB WARNING function to explicitly turn on or off certain warnings. In order to do so for the parameterized link warnings you can use the following lines of code:
warning off Simulink:SL_SaveWithParameterizedLinks_Warning
warning off Simulink:SL_LoadMdlParameterizedLink
Please note for R2013a the following warning idenifiers should be used:
warning off Simulink:Engine:SaveWithParameterizedLinks_Warning
warning off Simulink:Commands:LoadMdlParameterizedLink
In order to make this happen for only one specific model, you could consider including warning on/off statements in your models PreLoadFcn, PostLoadFcn, PreSaveFcn and PostSaveFcn callback functions.
If the above warning IDs, do not resolve the issue, you can use the following MATLAB command to retrieve the ID of the last warning message:
[msgstr,msgid]=lastwarn
You can then use the actual 'msgid' with the WARNING command to turn off the warnings.