MATLAB Creating Graphical User Interfaces

(Barry) #1

6 Lay Out a UI Using GUIDE


To define user interface controls, you must set certain properties. To do this:

1 Use the Property Inspector to modify the appropriate properties. Open the Property
Inspector by selecting View > Property Inspector or by clicking the Property

Inspector button.
2 In the layout area, select the component you are defining.

Subsequent topics describe commonly used properties of user interface controls and offer
a simple example for each kind of control:


  • “Commonly Used Properties” on page 6- 24

  • “Push Button” on page 6- 25

  • “Slider” on page 6- 27

  • “Radio Button” on page 6- 29

  • “Check Box” on page 6- 31

  • “Edit Text” on page 6- 32

  • “Static Text” on page 6- 34

  • “Pop-Up Menu” on page 6- 36

  • “List Box” on page 6- 38

  • “Toggle Button” on page 6- 41


Note:See “GUIDE Components” on page 6-13 for descriptions of these components. See
“Callbacks for Specific Components” on page 8-11 for basic examples of programming
these components.

Commonly Used Properties

The most commonly used properties needed to describe a user interface control are shown
in the following table. Instructions for a particular control may also list properties that
are specific to that control.

Property Value Description
Enable on, inactive, off. Default
is on.

Determines whether the
control is available to the user
Free download pdf