Book contents
- Frontmatter
- Contents
- Preface
- 1 Getting Started
- 2 MATLAB Basics
- 3 Interacting with MATLAB
- Practice Set A: Algebra and Arithmetic
- Practice Set B: Calculus, Graphics, and Linear Algebra
- 6 MATLAB Programming
- 7 Publishing and M-Books
- 8 Simulink
- 9 ☆ GUIs
- 10 Applications
- Practice Set C: Developing Your MATLAB Skills
- Solutions to the Practice Sets
- Glossary
- Index
9 - ☆ GUIs
Published online by Cambridge University Press: 05 September 2012
- Frontmatter
- Contents
- Preface
- 1 Getting Started
- 2 MATLAB Basics
- 3 Interacting with MATLAB
- Practice Set A: Algebra and Arithmetic
- Practice Set B: Calculus, Graphics, and Linear Algebra
- 6 MATLAB Programming
- 7 Publishing and M-Books
- 8 Simulink
- 9 ☆ GUIs
- 10 Applications
- Practice Set C: Developing Your MATLAB Skills
- Solutions to the Practice Sets
- Glossary
- Index
Summary
With MATLAB you can create your own Graphical User Interface, or GUI, which consists of a Figure window containing menus, buttons, text, graphics, etc., that a user can manipulate interactively with the mouse and keyboard. There are two main steps in creating a GUI: one is designing its layout, and the other is writing callback functions that perform the desired operations when the user selects different features.
GUI Layout and GUIDE
Specifying the location and properties of various objects in a GUI can be done with commands such as uicontrol, uimenu, and uicontextmenu in an M-file. MATLAB also provides an interactive tool (a GUI itself!) called GUIDE (this stands for Graphical User Interface Development Environment) that greatly simplifies the task of building a GUI. We will describe here how to get started writing GUIs with the MATLAB 7 version of GUIDE, which has some significant enhancements over earlier versions. The version of GUIDE in MATLAB 6 is roughly similar, but some of the menu items and options are different or missing.
✓ One possible drawback of GUIDE is that it equips your GUI with commands that are new in MATLAB 7 and it saves the layout of the GUI in a binary.fig file. If your goal is to create a robust GUI that many different users can use with different versions of MATLAB, you may be better off writing the GUI from scratch as an M-file.
- Type
- Chapter
- Information
- A Guide to MATLABFor Beginners and Experienced Users, pp. 123 - 130Publisher: Cambridge University PressPrint publication year: 2006