Creating Graphical User Interfaces    

Saving and Running the 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.

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.

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

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

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:


  Using the Object Browser to Identify Callbacks MATLAB GUIs