Simulink Preferences Model File Pane

Simulink Model File Preferences Overview

Set preferences for file change, autosave, version notifications, and other behaviors relating to model files

These options affect the behavior of all Simulink® models.

See Also

File format for new models and libraries

Settings

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.

Command-Line Information

Parameter: ModelFileFormat
Value: 'mdl' | 'slx'
Default: slx

Tip

You can choose model file format when using Save As.

See Also

Save Models in the SLX File Format

Save a thumbnail image inside SLX files

Specify whether to save a small screenshot of the model to display in the Current Folder browser preview pane.

Settings

Default: On

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.

Off

Do not save a screenshot of the model.

Tip

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.

Command-Line Information

Parameter: SaveSLXThumbnail
Value: 'on' | 'off'
Default: on

Change Notification

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:

Updating or simulating the model

Specify whether to notify if the model has changed on disk when updating or simulating the model.

Settings

Default: On

On

Notify if the model has changed on disk when updating or simulating the model. Select the action to take in the Action list.

Off

Do not notify if the model has changed on disk when updating or simulating the model.

Tip

To programmatically check whether the model has changed on disk since it was loaded, use the function slIsFileChangedOnDisk.

Dependency

This parameter makes Action available.

Command-Line Information

Parameter: MDLFileChangedOnDiskChecks
Type: struct, field name: CheckWhenUpdating
Value: true | false | 1 | 0
Default: true

See Also

Model File Change Notification

Action

Select the action to take if the file has changed on disk since it was loaded.

Settings

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.

Tip

To programmatically check whether the model has changed on disk since it was loaded, use the function slIsFileChangedOnDisk.

Dependency

This parameter is enabled by the Updating or simulating the model parameter.

Command-Line Information

Parameter: MdlFileChangedOnDiskHandling
Value: 'Warning' | 'Error' | 'Reload model (if unmodified)' | 'Show prompt dialog'
Default: 'Warning'

See Also

Model File Change Notification

First editing the model

Specify whether to notify if the file has changed on disk when editing the model.

Settings

Default: On

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

Off

Do not check for changes on disk when first editing the model.

Tip

To programmatically check whether the model has changed on disk since it was loaded, use the function slIsFileChangedOnDisk.

Command-Line Information

Parameter: MDLFileChangedOnDiskChecks
Type: struct, field name: CheckWhenEditing
Value: true | false | 1 | 0
Default: true

See Also

Model File Change Notification

Saving the model

Specify whether to notify if the file has changed on disk when saving the model.

Settings

Default: On

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.

Off

Do not check for changes on disk when saving the model.

Tip

To programmatically check whether the model has changed on disk since it was loaded, use the function slIsFileChangedOnDisk.

Command-Line Information

Parameter: MDLFileChangedOnDiskChecks
Type: struct, field name: CheckWhenSaving
Value: true | false | 1 | 0
Default: true

See Also

Model File Change Notification

Autosave Options

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:

Save before updating or simulating the model

Specify whether to automatically save a backup copy of the model before updating or simulating.

Settings

Default: On

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 MyModel.slx.autosave or MyModel.mdl.autosave.

Off

Do not automatically save a copy before updating or simulating.

Tips

  • 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.

    OptionResult
    RestoreOverwrite 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 MyModel.slx.original or MyModel.mdl.original.
    Delete AutosaveDelete the autosave copy.
    IgnoreLeave 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.

Command-Line Information

Parameter: AutoSaveOptions
Type: struct, field name: SaveOnModelUpdate
Value: true | false | 1 | 0
Default: true

Save backup when overwriting a file created in an older version of Simulink

Specify whether to automatically save a backup copy of the model when overwriting with a newer version of Simulink.

Settings

Default: On

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 MyModel.slx.Version or MyModel.mdl.Version, where Version is the last version that saved the model, e.g., R2010a.

Off

Do not automatically save a backup copy when overwriting a model with a newer version of Simulink.

Tip

To recover the original model, rename the backup copy to MyModel.mdl or MyModel.slx by deleting the Version suffix.

Command-Line Information

Parameter: AutoSaveOptions
Type: struct, field name: SaveBackupOnVersionUpgrade
Value: true | false | 1 | 0
Default: true

Notify when loading an old model

Specify whether to notify when loading a model last saved in a older version of Simulink software.

Settings

Default: Off

On

Print a message in the command window when loading a model last saved in an old version of Simulink software.

Off

No notification when loading old models.

Tips

  • 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.

Command-Line Information

Parameter: NotifyIfLoadOldModel
Value: 'on' | 'off'
Default: off

Do not load models created with a newer version of Simulink

Specify whether to load a model last saved in a newer version of Simulink software.

Settings

Default: On

On

Do not load any model last saved in a newer version of Simulink software, and print an error message in the command window.

Off

Load models last saved in a newer version of Simulink software, and print a warning message in the command window.

Tip

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.

Command-Line Information

Parameter: ErrorIfLoadNewModel
Value: 'on' | 'off'
Default: on

Do not load models that are shadowed on the MATLAB path

Specify whether to load a model that is shadowed by another file of the same name higher on the MATLAB path.

Settings

Default: Off

On

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

Off

Load shadowed models, and print a warning message in the command window.

Command-Line Information

Parameter: ErrorIfLoadShadowedModel
Value: 'on' | 'off'
Default: off

See Also

Shadowed Files.

Verify digital signature of protected model before opening

Specify whether to verify the signature on a protected model before opening it.

Settings

Default: Off

On

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.

Off

Open protected models without verifying digital signatures.

Command-Line Information

Parameter: ProtectedModelValidateCertificate
Value: 'on' | 'off'
Default: off

See Also

Reference Protected Model

Notify when opening a model in an unopened project

Specify whether to prompt to open the project containing the selected model.

Settings

Default: On

On

Prompt to open the selected model and the associated project.

Off

Open the selected model only.

See Also

Create a Project from a Model