Graphical User Interface (GUI) in Matlab: Dr. P. Purkait
Graphical User Interface (GUI) in Matlab: Dr. P. Purkait
(GUI)
in
MATLAB
Dr. P. Purkait
GUI
• (GUI) is a graphical display
• Enable user to perform interactive
tasks
• User of the GUI does not have to
create a script
• User of the GUI does not have to
type commands at the command line
• The GUI components can be menus,
toolbars, push buttons, radio
buttons, list boxes, and sliders
2
Example
Layout Area
6
Laying Out a GUI – The layout
editor
• Type guide in the command prompt
7
Placing a Component in the Layout Area
• Available Components
• Push Button
Component
palette with • Radio Button
names
• Check Box
• Edit Text Box
8
Example of GUI in the Layout
Editor
9
Assigning an Identifier to Each
Component
Use the Tag property to assign each component a
unique meaningful identifier
• Double click on the component for which you need to open the Property
Inspector
• In the Property Inspector, select Tag and then replace the value with the string
you want to use as the identifier
12
Alignment Tool
• The Alignment Tool
enables to position
objects with respect to
each other and to
adjust the spacing
between selected
objects
• Selecting
Property
Inspector in the
Tools menu
• Right-clicking on
a component
and selecting
Inspect
Properties from
the menu
14
Assignment 2
• Open the Properties of PUSH
BUTTON and check / change its
properties
15
Saving the GUI
• A FIG-file, with extension .fig, that
contains a complete description of
the GUI layout and the GUI
components
17
Programming the GUI
• callbacks
• Push Button
• Edit Text
• Radio Button
• Check Box
• Slider
• List Box
• Pop-Up Menu
• Axes
20