Graphics |
Exporting Data Value to Workspace Variable
You can export the values displayed with the data cursor to MATLAB workspace variables. To do this, display the right-click context menu while in data cursor mode and select Export Cursor Data to Workspace.
MATLAB then displays a dialog that enables you to name the workspace variable.
When you click OK, MATLAB creates a structure with the specified name in your base workspace, containing the following fields:
Target
-- Handle of the graphics object containing the data point
Position
-- x- and y- (and z-) coordinates of the data cursor location in axes data units
Line and lineseries objects have an additional field:
DataIndex
-- A scalar index into the data arrays that correspond to the nearest data point. The value is the same for each array.
For example, if you saved the workspace variable as cursor_info
, then you would access the position data by referencing the Position
field.
Selection Style -- Select Data Points or Interpolate Points on Graph | Zooming in 2-D and 3-D |
© 1994-2005 The MathWorks, Inc.