Main Content

Preferences

Open Preferences window to view and change preferences

Description

MATLAB® provides various preferences for customizing MATLAB. You can use the Preferences window to access and set MATLAB preferences.

Some preferences are not available in MATLAB Online™.

Preference window displaying the MATLAB General Preferences page

Open the Preferences

To open the Preferences window, do one of the following:

  • MATLAB Toolstrip: On the Home tab, in the Environment section, click Preferences.

  • MATLAB command prompt: Enter preferences.

To view or change preferences for MATLAB or related products, in the left pane of the Preferences window, select a product and then select from the available categories. Change preferences in the right pane of the Preferences window and then click Apply or OK to accept the changes.

Preferences take effect immediately and remain persistent across sessions of MATLAB.

Examples

expand all

Open the Preferences window with the MATLAB Colors Preferences page selected.

preferences Colors

In the MATLAB output colors section, select the colors that you want to use from the Error text, Warning text, and Hyperlinks color palettes. The new colors appear in the Command Window sample area.

Preference window displaying the MATLAB Colors Preferences page

Programmatic Use

expand all

preferences opens the Preferences window. If the Preferences window is already open, MATLAB brings focus to the tool.

You also can access and set some MATLAB options programmatically using settings. For more information, see Access and Modify Settings.

example

preferences page opens the Preferences window and selects the specified page.

example

More About

expand all

Tips

  • To restore the default preferences for a given release of MATLAB, delete all of the files in the corresponding preferences folder. Use the prefdir command to determine the full path of the preferences folder.

    For example, to restore the default preferences for R2021a, type prefdir in the Command Window to determine the location of the preferences folder.

    prefdir
    ans =
        'C:\Users\username\AppData\Roaming\MathWorks\MATLAB\R2021a'
    Close MATLAB, delete all of the files in the folder C:\Users\username\AppData\Roaming\MathWorks\MATLAB\R2021a and then start MATLAB again. MATLAB starts with all preferences set to their default values.

    One file to consider keeping is history.m. For more information, see Set Command History Preferences.

Version History

Introduced before R2006a