Set preferences for file change, autosave, version notifications, and other behaviors relating to model files
These options affect the behavior of all Simulink® models.
Default:SLX
Specify the default file format for new models and libraries.
MDL
Save new models and libraries in MDL format.
SLX
Save new models and libraries in SLX format.
Parameter:
ModelFileFormat |
Value:
'mdl' | 'slx' |
Default:
slx |
You can choose model file format when using Save As.
Specify whether to save a small screenshot of the model to display in the Current Folder browser preview pane.
Default: On
When saving the model, include a small screen shot of the model inside the SLX file. You can view the screen shot for a selected model in the Current Folder browser preview pane.
Do not save a screenshot of the model.
If your model is very large and you want to reduce the time taken to save the model, then you can turn this preference off to avoid saving thumbnail model images.
Parameter:
SaveSLXThumbnail |
Value:
'on' | 'off' |
Default:
on |
Use these preferences to specify notifications if the model has changed on disk when you update, simulate, edit, or save the model. When updating or simulating, you can choose whether to warn, error, reload if unmodified, or show a dialog box that lets you choose to reload or ignore. For more information, see Model File Change Notification.
You can set these options under Change Notification:
Specify whether to notify if the model has changed on disk when updating or simulating the model.
Default: On
Notify if the model has changed on disk when updating or simulating the model. Select the action to take in the Action list.
Do not notify if the model has changed on disk when updating or simulating the model.
To programmatically check whether the model has changed on disk since it was
loaded, use the function slIsFileChangedOnDisk
.
This parameter makes Action available.
Parameter:
MDLFileChangedOnDiskChecks |
Type: struct, field name: CheckWhenUpdating |
Value:
true | false | 1 |
0 |
Default:
true |
Select the action to take if the file has changed on disk since it was loaded.
Default:
Warning
Warning
Displays a warning in MATLAB® command window
Error
Displays an error. If simulating programmatically, the error appears in the MATLAB command window. If simulating interactively, the error appears in a Simulation Diagnostics window.
Reload model (if unmodified)
Reloads if the model is unmodified. If the model is modified, the prompt dialog box appears.
Show prompt dialog
Shows prompt dialog box in which you can choose to close and reload or ignore the changes.
To programmatically check whether the model has changed on disk since it was
loaded, use the function slIsFileChangedOnDisk
.
This parameter is enabled by the Updating or simulating the model parameter.
Parameter:
MdlFileChangedOnDiskHandling |
Value:
'Warning' | 'Error' | 'Reload
model (if unmodified)' | 'Show prompt
dialog' |
Default:
'Warning' |
Specify whether to notify if the file has changed on disk when editing the model.
Default: On
Displays a warning if the file has changed on disk when you modify
the block diagram. Any interactive operation that modifies the block
diagram (e.g., adding a block) causes a warning dialog box to
appear. Any programmatic operation that causes the block diagram to
be modified (e.g., a call to set_param
) causes a
warning in the MATLAB Command Window
Do not check for changes on disk when first editing the model.
To programmatically check whether the model has changed on disk since it was
loaded, use the function slIsFileChangedOnDisk
.
Parameter:
MDLFileChangedOnDiskChecks |
Type: struct, field name: CheckWhenEditing |
Value:
true | false | 1 |
0 |
Default:
true |
Specify whether to notify if the file has changed on disk when saving the model.
Default: On
Notify if the file has changed on disk when you save the model.
Saving the model in the Simulink Editor causes a dialog box to appear. In the dialog box, you can choose to overwrite or save with a new name.
The save_system
function displays an
error, unless you use the
OverwriteIfChangedOnDisk
option.
Do not check for changes on disk when saving the model.
To programmatically check whether the model has changed on disk since it was
loaded, use the function slIsFileChangedOnDisk
.
Parameter:
MDLFileChangedOnDiskChecks |
Type: struct, field name: CheckWhenSaving |
Value:
true | false | 1 |
0 |
Default:
true |
Use the autosave preferences to specify whether to automatically save a backup copy of the model before updating or simulating, or when overwriting with a newer version of Simulink.
For more information, see these options:
Specify whether to automatically save a backup copy of the model before updating or simulating.
Default: On
If the model has unsaved changes, automatically save a backup copy of the model before updating or simulating. This autosave copy can be useful for crash recovery.
The copy is saved in the same directory as the model, with the
name
or
MyModel
.slx.autosave
.MyModel
.mdl.autosave
Do not automatically save a copy before updating or simulating.
If you open or load a model that has a more recent autosave copy available, then after the model loads, a dialog box prompts to restore, ignore, or discard the autosave copy. If multiple models area involved, then the Model Recovery dialog box appears.
For each model listed, you can select a check box to specify any of these options. Or you can click the Restore All, Delete All or Ignore All button to select that option for all listed models.
Option | Result |
---|---|
Restore | Overwrite the original model file with the
autosave copy, and delete the autosave copy.
Simulink will close the model and reload from
the restored file. If you select the check box to
Keep a copy of original model
file, you can save copies of the
original model files named
or
. |
Delete Autosave | Delete the autosave copy. |
Ignore | Leave the model and the autosave copy untouched. This setting is the default. The next time you open the model, the Model Recovery dialog will reappear and you can choose to restore or delete autosave files. |
Closing a modified model deletes any autosave copy.
Autosave does not occur for models that are part of the MATLAB installation, so you will not create autosave copies of those models.
Autosave does not occur if the autosave file or location is read-only.
Autosave does not occur in Parallel Computing Toolbox™ workers.
Caution
If a segmentation violation occurred, then the last autosave file for the model reflects the state of the autosave data prior to the segmentation violation. Because Simulink models might be corrupted by a segmentation violation, Simulink does not autosave a model after a segmentation violation occurs.
Parameter:
AutoSaveOptions |
Type: struct, field name: SaveOnModelUpdate |
Value:
true | false | 1 |
0 |
Default:
true |
Specify whether to automatically save a backup copy of the model when overwriting with a newer version of Simulink.
Default: On
If saving the model with a newer version of Simulink, automatically save a backup copy of the model. This backup copy can be useful for recovering the original file in case of accidental overwriting with a newer version.
The backup copy is saved in the same directory as the model, with
the name
or
MyModel
.slx.Version
,
where MyModel
.mdl.Version
Version
is the last version that
saved the model, e.g., R2010a
.
Do not automatically save a backup copy when overwriting a model with a newer version of Simulink.
To recover the original model, rename the backup copy to
or
MyModel
.mdl
by deleting
the MyModel
.slxVersion
suffix.
Parameter:
AutoSaveOptions |
Type: struct, field name: SaveBackupOnVersionUpgrade |
Value:
true | false | 1 |
0 |
Default:
true |
Specify whether to notify when loading a model last saved in a older version of Simulink software.
Default: Off
Print a message in the command window when loading a model last saved in an old version of Simulink software.
No notification when loading old models.
Run the Upgrade Advisor to convert the block diagram to the format of the current version of Simulink software.
For advice on upgrading a model to the current version of Simulink, see Model Upgrades.
Parameter:
NotifyIfLoadOldModel |
Value:
'on' | 'off' |
Default:
off |
Specify whether to load a model last saved in a newer version of Simulink software.
Default: On
Do not load any model last saved in a newer version of Simulink software, and print an error message in the command window.
Load models last saved in a newer version of Simulink software, and print a warning message in the command window.
If possible, use the Save As command to convert the block diagram to the format of the desired version of Simulink software. The Save As command allows you to save a model created with the latest version of the Simulink software in formats used by earlier versions. See Export a Model to a Previous Simulink Version.
Parameter:
ErrorIfLoadNewModel |
Value:
'on' | 'off' |
Default:
on |
Specify whether to load a model that is shadowed by another file of the same name higher on the MATLAB path.
Default: Off
Do not load any model that is shadowed by another file of the same name higher on the MATLAB path, and print an error message in the command window. This preference applies when you try to open or load a model or library by either:
Selecting a file in the current folder browser
Calling open_system
or
load_system
with a path to a
file in a different folder to the current folder
Load shadowed models, and print a warning message in the command window.
Parameter:
ErrorIfLoadShadowedModel |
Value:
'on' | 'off' |
Default:
off |
Specify whether to verify the signature on a protected model before opening it.
Default: Off
Do not load a protected model that does not have a verified digital signature. Show an error if signature verification finds any of the following:
The protected model was changed after it was signed.
The protected model was not signed.
The protected model was signed with an expired certificate.
The protected model was self-signed with a certificate issued by the author.
The protected model was signed with a missing or invalid certificate.
The certificate in your system certificate authority store is missing or invalid.
The model was signed with an invalid key.
Verification does not check if the certificate expired or was revoked after the protected model was signed.
This preference applies when you try to open or load a protected model by:
Simulating or generating code for a model that references the protected model
Performing an action that updates the diagram for a model that references the protected model
Opening the Web view of the protected model
Opening the protected model report
You can suppress the diagnostic for an unverified protected model when the error message appears in the Diagnostic Viewer. The error cannot be suppressed if the signature is not valid because model was changed after it was signed.
Open protected models without verifying digital signatures.
Parameter:
ProtectedModelValidateCertificate |
Value:
'on' | 'off' |
Default:
off |
Specify whether to prompt to open the project containing the selected model.
Default: On
Prompt to open the selected model and the associated project.
Open the selected model only.