| MATLAB® | ![]() |
Start by creating an M-file for the example GUI.
Type or copy the following statement into the editor. This function statement is the first line in the file.
function simple_gui2
Add these comments to the M-file following the function statement. They are displayed at the command line in response to the help command. They must be followed by a blank line.
% SIMPLE_GUI2 Select a data set from the pop-up menu, then
% click one of the plot-type push buttons. Clicking the button
% plots the selected data in the axes.
(Leave a blank line here)Add an end statement at the end of the file. This end statement matches the function statement. Your file now looks like this.
function simple_gui2 % SIMPLE_GUI2 Select a data set from the pop-up menu, then % click one of the plot-type push buttons. Clicking the button % plots the selected data in the axes. end
Note You need the end statement because the example is written using nested functions. For information about using nested functions, see Nested Functions in the MATLAB Programming Fundamentals documentation. |
Save the file in your current directory or at a location that is on your MATLAB path.
The next section, Laying Out a Simple GUI, shows you how to add components to your GUI.
![]() | Function Summary | Laying Out a Simple GUI | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |