User`s guide
15 Examples of GUIs Created Programmatically
The GUI toolbar has two buttons:
• The Open button
performs the same function as the Open menu item. It
displays a dialog from which you can open files on your com puter.
• The Print button
performs the same function as the Print menu item. It
opens the Print dialog. Clicking Yes in the Print dialog prints the plot.
This example illustrates the following GUI-building techniques:
• Passing input arguments to the GUI when it is opened
• Obtaining output from the GUI when it returns
• Shielding the GUI from accidental changes
• Running the GUI across multiple platforms
• Creating menus
• Creating toolbars
• Ach ievin g proper resize behavior
Note This example uses nested functions. For information about using
nested functions, see “Nested F unctions”.
View and Run the AxesMenuToolbar Code
If you a re reading this example example in the MATLAB Help browser,
you can access the example code files by clicking the following links. If you
are reading on the Web or in a PDF, go to the corresponding section in the
MATLAB Help Browser to use the links.
If you intend to modify the layout or code of this GUI example, you should
first save a copy of its code in your current folder (You need write access
to you r current folder to do this.) Click on the follow in g links to copy the
example files to your current folder and open them.
1 Click here to copy the code files to your current folder
2 edit axe sMen uToolbar.m or click here to o pen the GU I code in the Editor
15-6