Main Content

Modify Workspace and Variables Settings

Workspace Settings

You can customize the saving of variables as MATLAB® script files, the display of statistical calculations in the Workspace panel, and the MATLAB array size limit by using Workspace settings.

On the Home tab, in the Environment section, click Settings. Select MATLAB > Workspace, and then adjust these options.

SettingUsage
Thresholds for saving variables to MATLAB script

In the Maximum array size box, enter the maximum number of array elements to save in a MATLAB script. Arrays exceeding this size are saved in a companion MAT file.

In the Maximum struct/object nesting levels field, enter the maximum number of structure or object nesting levels to save in a MATLAB script. Structures or objects exceeding this depth are saved in a companion MAT file.

Multidimensional array formatting

These settings specify how multidimensional arrays are formatted when saved to a MATLAB script.

Select Row vector with reshape for compactness and efficiency.

Select As 2-D pages to maintain array representation and readability. Then, in the Array dimensions to appear in 2-D pages boxes, specify the dimensions of a 2-D slice. The dimensions must be positive integers less than or equal to the array dimensions, and the second integer must be greater than the first.

File formatting

In the Maximum characters per line box, enter the maximum number of characters to allow in the MATLAB script before wrapping the text when you save variables to a MATLAB script.

Statistical calculations

n element and smaller arrays show statistics specifies the maximum number of array elements for calculating statistics in the Workspace panel. You can improve the performance of the Workspace panel by omitting statistics for large arrays.

Select Ignore NaNs when calculating statistics for the Workspace panel to ignore missing values when computing statistics to display.

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. You can 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 unresponsive.

Variables Settings

You can customize the default array format, cursor movement, placement of missing values for sorting, code generation, and the display of sparklines and summary statistics in the Variables editor by using the Variables settings.

Note

You can also use the Variable and View tabs for the Variables editor to control some of these settings.

On the Home tab, in the Environment section, click Settings. Select MATLAB > Variables, and then adjust these options.

SettingUsage
Format

From the Default array format list, select a default display format for numeric values in the Variables editor. This setting does not affect how numbers display in the Command Window or how MATLAB computes or saves numbers. For information on formatting options, see the format function.

EditingAfter you make changes to an element in the Variables editor, you can press Enter to save your changes and move to the next element. Clear Move selection after Enter to save your changes and keep the current element selected when you edit an element and press Enter.

By default, the focus moves down to the next element. To specify a different direction to move the focus, select a direction from the Direction list.

SortingFrom the Placement of missing values list, select the placement of missing values, such as NaN and NaT, when you sort data. Alternatively, specify the MissingPlacement name-value argument when you sort data using the sort or sortrows functions.
Code GenerationBy default, the Command Window displays generated code when you perform operations in the Variables editor. Clear the Show MATLAB code for operations check box to hide this code.
Tabular Variable Display

Select the Display sparklines check box to display sparklines in the variable headers for table and timetable data in the Variables editor.

Select the Display summary statistics check box to display summary statistics in the variable headers for table and timetable data in the Variables editor.

Enter a value in the Maximum number of text elements to display sparklines or summary statistics box to omit sparklines and summary statistics for large table and timetable data in the Variables editor.

See Also

|