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

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 330
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 40
Programming the GUI
2-21
% Create the data to plot.
handles.peaks=peaks(35);
handles.membrane=membrane;
[x,y] = meshgrid(-8:.5:8);
r = sqrt(x.^2+y.^2) + eps;
sinc = sin(r)./r;
handles.sinc = sinc;
% Set the current data value.
handles.current_data = handles.peaks;
surf(handles.current_data)
The first six executable lines create the data using the MATLAB functions
peaks, membrane and sinc. They store the data in the handles structure,
which is passed as an argument to all callbacks. Callbacks for the push
buttons can retrieve the data from the
handles structure.
The last two lines create a current data value and set it to peaks, and then
display the surf plot for peaks. The following figure shows how the GUI now
looks when it first displays.
Programming the Pop-Up Menu
The pop-up menu enables users to select the data to plot. When a user selects
one of the three plots, MATLAB sets the pop-up menu
Value property to the
Vista de página 40
1 2 ... 36 37 38 39 40 41 42 43 44 45 46 ... 329 330

Comentários a estes Manuais

Sem comentários