MATLAB SIMULINK 7 - GRAPHICAL USER INTERFACE Manual do Utilizador Página 217

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 330
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 216
Mechanisms for Managing Data
9-5
The following table summarizes the functions that provide access to
application data. For more detailed information, see the individual function
reference pages.
Creating Application Data in GUIDE
Use the setappdata function to create application data. This example
generates a 35-by-35 matrix of normally distributed random numbers in the
opening function and creates application data
mydata to manage it.
function mygui_OpeningFcn(hObject, eventdata, handles, varargin)
matrices.rand_35 = randn(35);
setappdata(hObject,'mydata',matrices);
Because this code appears in the opening function, hObject is the handle of the
GUI figure, and the code associates
mydata with the figure.
Adding Fields to an Application Data Structure in GUIDE
Application data is usually defined as a structure to enable you to add fields as
necessary. In this example, a push button adds a field to the application data
structure
mydata created in the previous topic.
Functions for Managing Application Data
Function Purpose
setappdata
Specify named application data for an object. The object
does not have to be a figure. You can specify more than
one named application data for an object. However,
each name must be unique for that object and can be
associated with only one value, usually a structure.
getappdata
Retrieve named application data. To retrieve named
application data, you must know the name associated
with the application data and the handle of the object
with which it is associated.
isappdata
True if the named application data exists.
rmappdata
Remove the named application data.
Vista de página 216
1 2 ... 212 213 214 215 216 217 218 219 220 221 222 ... 329 330

Comentários a estes Manuais

Sem comentários