Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

Share this Page URL

Chapter 13. *Graphical User Interfaces (... > A First Example: Getting the Time - Pg. 264

264 CH A P T E R 13: *Graphical User Interfaces (GUIs) contains all the tools needed to create and lay out the GUI components (e.g., push buttons, menus, radio buttons, pop-up menus, axes). These are called uicontrols in MATLAB (for user interface controls). GUIDE generates two files that save and launch the GUI: a FIG-file and an application M-file. The FIG-file contains a complete description of the GUI figure, that is, whatever uicontrols and axes are needed for your graphical interface. The application M-file contains the functions required to launch and control the GUI. The GUI is controlled largely by callback functions, which are subfunctions in the application M-file. They are written by you and determine what action is taken when you interact with a GUI component (e.g., click a button). GUIDE generates a callback function prototype for each GUI component you create. You then use the Editor to fill in the details. 13.2 A FIRST EXAMPLE: GETTING THE TIME For our first example we will create a GUI with a single push button. When you