Main Content

Workspace and Variable Preferences

Workspace Preferences

Workspace preferences enable you to configure options for saving workspace variables to MATLAB® scripts. They also enable you to restrict the size of arrays on which MATLAB performs calculations, and to specify if you want those calculations to include or ignore NaNs.

To open Workspace preferences, on the Home tab, in the Environment section, click Preferences. Select MATLAB > Workspace. Workspace preferences are not available in MATLAB Online™.

Threshold for saving variables to MATLAB script



Multidimensional array formatting



To retain array representation, select As 2-D pages (readability). Specify the dimensions of a 2-D slice as positive integers less than or equal to the dimensions of the n-D array. The second integer must be greater than the first.

n element and smaller arrays show statistics


For more information, see Improve Workspace Browser Performance During Statistical Calculations.

Handling NaN values in calculations

Specify whether NaN values are included or excluded from calculations for the statistics displayed in the Workspace browser. You can select to either Use NaNs when calculating statistics or Ignore NaNs when calculating statistics.

MATLAB array size limit

By default, MATLAB can use up to 100% of the size of RAM (not including virtual memory) of your computer to allocate memory for each MATLAB array. To change this limit to a smaller percentage, select the Limit the maximum array size to a percentage of RAM check box. Then move the slider to adjust the percentage of RAM.

To allow MATLAB to use both RAM and virtual memory when creating an array, clear the Limit the maximum array size to a percentage of RAM check box. If MATLAB attempts to allocate memory that exceeds the resources available on the computer, your system might become nonresponsive.

This limit applies to the size of each array, not the total size of all MATLAB arrays.

Variables Preferences

When working in the Variables editor, Variables preferences enable you to specify array formatting, cursor movement, and the decimal separator for exporting data using the system clipboard.





Specify where the cursor moves to after you type an element and press Enter.



International number handling

In the Decimal separator for exporting numeric data via system clipboard field, specify the decimal separator for numbers you cut or copy from the Variables editor and then paste into text files or other applications.


Most Variables preferences are not available in MATLAB Online. To show generated code in the Command Window when performing operations in the MATLAB Online Variables Editor, select Show MATLAB code for operations.

Related Topics