MATLAB SIMULINK 7 - GRAPHICAL USER INTERFACE Bedienungsanleitung Seite 41

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 330
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 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
Seitenansicht 40
1 2 ... 36 37 38 39 40 41 42 43 44 45 46 ... 329 330

Kommentare zu diesen Handbüchern

Keine Kommentare