Creating Graphical User Interfaces Previous page   Next Page

Saving and Running a GUI

After writing the callbacks, you can run the GUI by selecting Run from the Tools menu or clicking the Run button on the GUIDE toolbar. If you have not saved the GUI recently, GUIDE displays the following dialog box.

result of selecting run on tools menu or clicking run button

If this happens, click Yes and then save the GUI files to a writable directory.

If the directory where you save the GUI is not on the MATLAB path, GUIDE opens the following dialog, giving you the option of changing the current working directory to the directory containing the GUI files, or adding that directory to the MATLAB path.

directory selection dialog

Click OK to change the current working directory. GUIDE then opens the GUI as shown in the following figure.

simple GUI displaying a mesh plot of peaks data

Next, select membrane in the pop-up menu and click the Contour push button. The GUI should look like the following figure.

simple GUI showing membrane

Try experimenting with this GUI by adding another data set in the opening function, and a push button that displays a plot of the data set. Make sure to add the name of the new data set to the pop-up menu as well.

For more examples of creating GUIs with GUIDE, see the following sections:


Previous page  Using the Object Browser to Identify Callbacks Laying Out GUIs and Setting Properties Next page

© 1994-2005 The MathWorks, Inc.