getappdata

Gets the application data of an object.

Syntax

R = getappdata(handle)

R = getappdata(handle, dataname)

Inputs

handle
Handle of the object to retrieve application data from.
Type: double
dataname
Name of the data to be retrieved.
Type: string

Outputs

R
Value of the data. If dataname is omitted, getappdata will return all available application data for this object.
Type: [any]

Examples

getappdata example:

f = figure;
setappdata(f, 'data1', 1);
getappdata(f, 'data1')
ans = 1
Get all application data of an object:
f = figure;

setappdata(f, 'data1', 1)
setappdata(f, 'data2', [1:10])
ans = struct [
  data1: 1
  data2: [Matrix] 1 x 10
  1  2  3  4  5  6  7  8  9  10
]