
8 Programming the GUI
8-28
plotting of a graph to an axes. In this case, the button’s Callback callback
contains the code that generates the plot.
This example plots a graph in an axes when a button is pressed. The following
figure shows a push button and an axes as they might appear in the Layout
Editor.
1 Add this code to the push button’s Callback callback. The surf function
produces a 3-D shaded surface plot.
peaks is a function of two variables,
obtained by translating and scaling Gaussian distributions.
surf(peaks(35));
2 Run the GUI by selecting Run from the Tools menu.
3 Click the Plot button. The plot displays in the axes.
Commenti su questo manuale