Products & Services Solutions Academia Support User Community Company

Learn more about MATLAB   

openvar - Open workspace variable in Variable Editor or other graphical editing tool

GUI Alternatives

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

Syntax

openvar('varname')

Description

openvar('varname') opens the workspace variable varname in the Variable Editor for graphical editing, where name is a one- or two-dimensional array, character string, cell array, structure, or an object and its properties. You also can view the contents of a multidimensional array. Changes that you make to variables in the Variable Editor occur in the workspace as soon as you enter them.

You need to enclose the variable's name in single quotation marks because the Variable Editor needs to know the name of the variable to be notified if the variable changes value is deleted or goes out of scope. Typing openvar(varname) instead of openvar('varname'), passes the Variable Editor the value of varname instead of its name, and generally results in an error. However, openvar varname and openvar 'varname' both work, because string arguments are assumed when using command syntax. See Command vs. Function Syntax in the MATLAB Programming Fundamentals documentation for more information.

The MATLAB software does not impose any limitation on the size of a variable that you can open in the Variable Editor. Your operating system or the amount of physical memory installed on your computer can impose such limits, however.

In some toolboxes, openvar opens a tool appropriate for viewing or editing objects they define instead of opening the Variable Editor.

Data Brushing in the Variable Editor

The Data Brushing tool and the brush function let you manually highlight portions of graphs in the figure. You can also connect the data within graphs of numeric variables to their data sources (using the Linked Plot tool in the figure window or the linkdata function).

When you link graphs to source data and view the source data in the Variable Editor, observations that you highlight on graphs in Data Brushing mode also appear highlighted in the Variable Editor. Likewise, cells that you select in the Variable editor with its Data Brushing Tool appear highlighted in all linked figures which graph the variable.

Example — Identifying Outliers in a Linked Graph

Data Brushing helps to identify unusual observations in a data set that might warrant further analysis, for example extreme values. To explore this capability, follow these steps:

  1. Make a scatter plot of data in MAT-file count.dat, and open the variable count in the Variable Editor. For example:

    load count.dat
    scatter(count(:,1),count(:,2))
    openvar('count')
  2. Open the Variable Editor, turn on its Data Brushing mode, and select the three highest values (rows 7, 8, and 20). (You select noncontiguous rows by holding down the Ctrl key and clicking them.)

  3. Turn on Data Brushing mode and Data Linking mode for the figure with the scatter plot, or type the following commands:

    brush on
    linkdata on
    

    The data observations you brushed in the Variable Editor appear highlighted in the scatter plot, as the following figure shows.

    Now brush other observations in the scatter plot and notice how the Variable Editor highlights these values, as long as the figure is in data linking mode. 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 Variable Editor, but only the display that you brush responds by highlighting.

    You can turn data brushing on and off and perform a number of operations on brushed data from the Brushing item on the Edit menu. The operations include removing and replacing brushed observations, copying them to the clipboard or Command Window, and creating a new variable containing them. A Brushing context menu item also provides these options.

See Also

brush, linkdata, load, save, workspace

Viewing and Editing Workspace Variables with the Variable Editor in the MATLAB Desktop Tools and Development Environment Documentation.

Making Graphs Responsive with Data Linking in the MATLAB Data Analysis documentation.

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS