Main Content

openvar

Open workspace variable in Variables editor or other graphical editing tool

Description

openvar(varname) opens the workspace variable varname, in the Variables editor for graphical editing. Changes that you make to variables in the Variables editor occur in the workspace as soon as you enter them.

In some toolboxes, openvar opens a tool appropriate for viewing or editing objects indicated by varname instead of opening the Variables editor.

MATLAB® does not impose any limitation on the size of a variable that you can open in the Variables editor. However, your operating system or the amount of physical memory installed on your computer can impose such limits.

example

Examples

collapse all

Use data brushing to identify observations in a vector or matrix that might warrant further analysis.

Make a scatter plot of data in the sample MAT-file count.dat, and open the variable count in the Variables editor.

load count.dat
scatter(count(:,1),count(:,2))
openvar('count')

Right-click a cell in the Variables editor and select Brushing > Brushing On. This turns on data brushing in the Variables editor.

Select the rows 7, 8, and 20. (Select noncontiguous rows by holding down the Ctrl key and clicking in each row.)

Variables editor with rows 7, 8, and 20 selected

In the Figure window with the scatter plot, click Brush/Select Data to enable data brushing, and Link Plot to enable data linking.

The data observations you brushed in the Variables editor appear highlighted in the scatter plot.

Scatter plot that highlights the brushed data

As long as data linking is enabled in the figure, observations that you brush in the scatter plot are highlighted in the Variables editor. When a figure is not linked to its data sources, you can still brush its graphs and you can brush the same data in the Variables editor, but only the display that you brush responds by highlighting.

Input Arguments

collapse all

Variable name, specified as a character vector. The named variable can be an array, character vector, cell array, structure, or an object and its properties. If the named variable is a multidimensional array, then you can only view the array in the Variables editor, and not edit it.

Example: 'myVariable'

Example: 'A'

Tips

  • As an alternative to the openvar function, double-click a variable in the Workspace browser.

  • In MATLAB Online™, to move the Variables editor to the left, right, or bottom of the desktop, click the Document actions button () at the top of the Variables editor, select Move Variables, and then select from the available options.

Version History

Introduced before R2006a