User`s guide
13 Manage Application-Defined Data
See “Share Data with UserData” on page 13-15 for a complete example.
Application Data
Application data is data that is meaningful to or defined by your application.
You attach application data to a figure or any GUI component (other than
ActiveX controls) with the functions
setappdata and getappdata,Themain
differences betwe en it and UserData are:
• You can assign multiple values to application data, but only one value
to
UserData.
• Your code must reference application data by name (like using a Tag), but
can access
UserData like any other property
Only Handle Graphics M ATLAB objects use this property. The following table
summarizes the functions that provide access to application data. For more
details, see the individual function reference pages.
Functions for Managing Application Data
Function Purpose
setappdata
Specify named application data for an object (a
figure or other Handle Graphics object in your GUI).
You can specify more than one named application
data item per object. However, each name must be
unique for that object and can be associated with
only one value, usually a structure.
getappdata
Retrieve nam ed application data. To retrieve
named application data, you m ust know the name
associated with the application data and the handle
of the object with which it is associated. If you
specify a handle only, all the object’s application
data is returned.
isappdata
True if the named application data ex ists on the
specified obje c t.
rmappdata
Remove named application data from the s pecified
object.
13-6