Documentation Center

  • Trial Software
  • Product Updates

Main Pane

Simulink Preferences Window Overview

The Simulink® Preferences window comprises the following panes:

  • General Preferences (root level)

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

  • Display Defaults for New Models

    Configure display options for the Model Browser, block connection lines and port data types.

  • Font Defaults for New Models

    Configure font options for blocks, lines and annotations.

  • Editor Defaults

    Configure the Simulink Editor.

  • Data Management Defaults

    Configure for exporting variables to MATLAB® scripts.

  • Configuration Defaults

    Edit the template Configuration Parameters to be used as defaults for new models.

Click items in the tree to select panes.

Configuration

  1. On the root level pane, select the check boxes to configure preferences.

  2. Close the window to apply your changes.

    Click Apply to apply your changes and keep the window open.

Your settings affect the behavior of all Simulink models, including those currently open, and all subsequent models. Your preference settings are preserved for the next time you use the software.

See Also

Model File 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 the action to take: warn, error, reload if unmodified, or show a dialog box where you can choose to reload or ignore. For more information, see Model File Change NotificationModel File Change Notification.

The frame contains these controls:

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 enables Action.

Command-Line Information

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

See Also

Model File Change NotificationModel File Change Notification

Action

Select what 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, at the MATLAB command window if simulating from the command line, or if simulating from a menu item, in the Simulation Diagnostics window.

Reload model (if unmodified)

Reloads if the model is unmodified. If the model is modified, you see the prompt dialog.

Show prompt dialog

Shows prompt dialog. In the dialog, 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.

Dependencies

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

Command-Line Information

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

See Also

Model File Change NotificationModel 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 graphical operation that modifies the block diagram (e.g., adding a block) causes a warning dialog to appear. Any command-line operation that causes the block diagram to be modified (e.g., a call to set_param) will result in a warning like this at the command line:

Warning: Block diagram 'mymodel' is being edited but file has 
changed on disk since it was loaded.  You should close and 
reload the block diagram.
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 NotificationModel 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.

  • The save_system function displays an error, unless the OverwriteIfChangedOnDisk option is used.

  • Saving the model by using the menu (File > Save) or a keyboard shortcut causes a dialog to be shown. In the dialog, you can choose to overwrite, save with a new name, or cancel the operation.

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 NotificationModel File Change Notification

Autosave

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 controls:

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 appears to prompt you whether to restore, ignore, or discard the autosave copy. If there are multiple models involved, then the following nonmodal Model Recovery dialog appears.

    For each model in the list, you can select a check box to specify whether to Restore, Delete Autosave, or Ignore. 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.

  • If you deliberately close a modified model, any autosave copy is deleted.

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

Tips

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

Command-Line Information

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

Warn when opening Model blocks with Normal Mode Visibility set to off

Show a warning when you open a model from Model blocks that have Normal Mode Visibility set to off.

All instances of a Normal mode referenced model are part of the simulation. However, Simulink displays only one instance in a model window; that instance is determined by the Normal Mode Visibility setting. Normal mode visibility includes the display of Scope blocks and data port values. When you open a model from a Model block that has Normal Mode Visibility set to off, the referenced model shows data from the instance of that model has Normal Mode Visibility set to on.

Settings

Default: On

On

After simulation, Simulink displays a warning if you try to open a referenced model from a Model block that has Normal Mode Visibility set to off. Simulink does not open the instance referenced by that Model block, but instead opens the instance that has Normal Mode Visibility set to on. The instance that has Normal Mode Visibility set to on has different input data sources than the instance referenced by the Model block that you opened.

Off

No warning displayed if, after simulation, you try to open a referenced model from a Model block that has Normal Mode Visibility set to off.

Tips

  • The warning box that Simulink displays includes an option to suppress the display of the warning in the future. If you enable that option, this preference is set to off. Use this preference to resume the display of that warning.

  • For more information, see Normal Mode Visibility.

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 slupdate('modelname') 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 software, see Consult the Model Advisor.

Command-Line Information

Parameter: NotifyIfLoadOldModel
Type: string
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: Off

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
Type: string
Value: 'on' | 'off'
Default: off

Callback tracing

Specify whether to display the model callbacks that Simulink software invokes when simulating a model.

Settings

Default: Off

On

Display the model callbacks in the MATLAB command window as they are invoked.

Callback tracing allows you to determine the callbacks the software invokes, and in what order, when you open or simulate a model.

Off

Do not display model callbacks.

Command-Line Information

Parameter: CallbackTracing
Type: string
Value: 'on' | 'off'
Default: 'off'

Open the sample time legend whenever sample time display is changed

Specify whether to display the Sample Time Legend whenever Sample Time Display is changed.

Settings

Default: On

On

Display the Sample Time Legend whenever you change Sample Time Display by selecting Colors, Annotations, or All from the Sample Time Display submenu. The model diagram is updated and the legend opens.

Off

Do not display the Sample Time Legend whenever Sample Time Display is changed.

Command-Line Information

Parameter: OpenLegendWhenChangingSampleTimeDisplay
Type: string
Value: 'on' | 'off'
Default: 'on'

File generation control

Use these preferences to control the locations at which model build artifacts are placed. By default, build artifacts are placed in the current working folder (pwd) at the time update diagram or code generation is initiated. For more information, see these controls:

Simulation cache folder

Specify root folder in which to put model build artifacts used for simulation.

Settings

Default:''

Enter a string specifying a valid folder path. If no path is specified, build artifacts are placed in the current working folder (pwd) at the time update diagram is initiated.

Tip

You can specify an absolute or relative path to the folder. For example:

  • C:\Work\mymodelsimcache and /mywork/mymodelsimcache specify absolute paths.

  • mymodelsimcache is a path relative to the current working folder (pwd). The software converts a relative path to a fully qualified path at the time the preference is set. For example, if pwd is '/mywork', the result is /mywork/mymodelsimcache.

  • ../test/mymodelsimcache is a path relative to pwd. If pwd is '/mywork', the result is /test/mymodelsimcache.

Command-Line Information

Parameter: CacheFolder
Type: string
Value: valid folder path
Default: ''

See Also

Simulation Target Output File Control

Code generation folder

Specify root folder in which to put Simulink Coder™ code generation files.

Settings

Default:''

Enter a string specifying a valid folder path. If no path is specified, build artifacts are placed in the current working folder (pwd) at the time code generation is initiated.

Tip

You can specify an absolute or relative path to the folder. For example:

  • C:\Work\mymodelgencode and /mywork/mymodelgencode specify absolute paths.

  • mymodelgencode is a path relative to the current working folder (pwd). The software converts a relative path to a fully qualified path at the time the preference is set. For example, if pwd is '/mywork', the result is /mywork/mymodelgencode.

  • ../test/mymodelgencode is a path relative to pwd. If pwd is '/mywork', the result is /test/mymodelgencode.

Command-Line Information

Parameter: CodeGenFolder
Type: string
Value: valid folder path
Default: ''

See Also

Control the Location for Generated Files in the Simulink Coder documentation

Print

Use a white canvas (background) or the canvas color of the model when printing a model.

Settings

Default: White

White

Use a white canvas.

Match Canvas Color

Match the canvas color of the model.

Command-Line Information

Parameter: PrintBackgroundColorMode
Type: string
Value: White | MatchCanvas
Default: White

See Also

Print and Export Models

Export

Match the canvas (background) color of the model, use a white canvas, or use a transparent canvas for model files that you export to another file format, such as .png or .jpeg.

Settings

Default: Match Canvas Color

Match Canvas Color

Match the canvas color of the model.

White

Use a white canvas.

Transparent

Use a transparent canvas, so that whatever is behind the canvas image shows through.

Command-Line Information

Parameter: ExportBackgroundColorMode
Type: string
Value: White | MatchCanvas | Transparent
Default: MatchCanvas

See Also

Export Models to Third-Party Applications

Clipboard

Match the canvas (background) color of the model, use a white canvas, or use a transparent canvas for model files that you export to another application.

Settings

Default: Match Canvas Color

Match Canvas Color

Match the canvas color of the model.

White

Use a white canvas.

Transparent

Use a transparent canvas, so that whatever is behind the canvas image shows through.

Command-Line Information

Parameter: ClipboardBackgroundColorMode
Type: string
Value: White | MatchCanvas | Transparent
Default: MatchCanvas

See Also

Export Models to Image File Formats

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
Type: string
Value: 'mdl' | 'slx'
Default: slx

Tips

  • You can choose model file format when using Save As.

  • To set this preference at the command-line, use one of the following commands:

    set_param(0,'ModelFileFormat','slx')
    set_param(0,'ModelFileFormat','mdl')
  • For information about the SLX model file format, see Saving Models in the SLX File Format.

Was this topic helpful?