MATLAB: How to set Simulink Preferences via the command line approach

simulink

Looking at one of the links that mention Command-Line Information in the Simulink Preferences documentation page (see below)…
 
Command-Line Information
Parameter: NotifyIfLoadOldModel*Value:* 'on' | 'off'*Default:* off  
When I try to execute this command on the command line, it is flagged as an undefined function or variable.
 
If I want to set this via a m script (I assume this is possible), what are the commands to do so?
 

Best Answer

You can use the "set_param" function with...
1) the first argument being "0"
2) the second argument being the specific command line parameter that you want to modify
3) the third argument being the actual value/setting that you would like to apply for the parameter
Using "0" for the first argument allows you to modify Simulink properties/preferences (i.e. those that are set for all Simulink models).
Below is an example for the "NotifyIfLoadOldModel" preference setting.  If you would like, you can open the Simulink Preferences dialog/menu to confirm that the changes to the setting have indeed been made.
>> set_param(0, 'NotifyIfLoadOldModel', 'on')