MATLAB Programming for
Engineers 7e By Stephen J.
Chapman
(All Chapters 1-14, 100% Original
Verified, A+ Grade)
All Chapters Arranged Reverse: 14-1
This is the Original Solutions Manual
for 7th Edition, All Other Files in the
Market are Wrong/Old Questions.
, Solution and Answer Guide: Chapman, MATLAB Programming for Engineers, 7e, CY2025, 9798214001531; Chapter 14:
Solution and Answer Guide
Chapman, MATLAB Programming for Engineers, 7e, CY2025, 9798214001531; Chapter 14:
14. Input / Output Functions
NOTE
In most of the book, we have been using strings instead of character arrays to represent most
text data, in accordance with MathWork’s preference. However, some of the GUI
components still require character arrays or cell arrays of character arrays to represent text
data. Therefore, the solutions in this chapter use more of the older style text data than in other
chapters.
14.1 Explain the steps required to create a GUI in MATLAB.
Solution
The basic steps required to create a MATLAB GUI are:
1. Decide what elements are required for the GUI, and what the function of each element will be.
Make a rough layout of the components by hand on a piece of paper.
2. Use the App Designer to lay out the components on a figure. The size of the figure, and the
alignment and spacing of components on the figure, can be adjusted using the tools built into
the App Designer.
3. Use the Property Inspector (built into the App Designer) to set the characteristics of each
component, such as its color, the text it displays, and so forth.
4. Use the Property Inspector to select the callback functions to create for each component,
including the name of the callback function.
5. Save the GUI to a file. When the GUI is saved, a file with extension mlapp will be created,
containing both the GUI and the dummy callback functions that you have specified.
6. Click on the “Code View” tab to see the autogenerated code that produces the figure. This code
will display dummy methods for each callback that you have defined. Now write the code
required to implement the callback functions.
14.2 What types of components can be used in MATLAB GUIs? What functions create them,
and how do you select a particular component type?
Solution
© 2025 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible 1
website, in whole or in part.
, Solution and Answer Guide:
The components that can be used in GUIs are shown in the following table, and the functions that
create each one are shown in the table.
Component / Example Description
(Creating
Function)
Containers
Menu Bar Creates a menu bar on a specified figure.
(uimenu)
Common Components
Axes A graphical component to display plots on.
(uiaxes)
Button A graphical component that implements a
(uibutton) button. Each mouse button click also triggers
a callback.
Check Box A checkbox is a type of component that
(uicheckbox) appears as a small square with a check mark in
it when it is “on”. Each mouse click on a check
box triggers a callback.
Context Menu A context menu is a menu that appears when
(uicontextmenu) you right-click a graphics object or UI
component.
Drop Down A drop-down list is a type of component that
(uidropdown) allows a user to select an option from the list,
or else type in text.
Edit Field (numeric) A component that allows a user to enter a
(uieditfield) numerical value. This is the same object as the
© 2025 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible 2
website, in whole or in part.
, Solution and Answer Guide:
text edit field, except that the "numeric"
option is specified.
Edit Field (text) A component that allows a user to enter a text.
(uieditfield)
Label A component that displays static text for
(uilabel) labeling items in an app. Labels never trigger
callbacks.
List Box A component for displaying items in a list. The
(uilistbox) user can select one or more items from the list.
Radio Button A component for displaying radio buttons,
(uiradiobutton) which are toggle buttons: one click turns on,
and the next click turns off. They appear as
circles with a dot inside when the button is on.
Slider A component for creating a slider, which
(uislider) allows a user to select a value from a
continuous set of choices by moving a bar
along the slider.
Spinner A component for creating a spinner, which
(uispinner) allows a user to select a value from a finite set
of choices.
State Button State buttons are toggle buttons that indicate a
(uibutton) logical state. The shading of the button
changes when it is on. State buttons are created
using a uibutton with the "state" option
added.
Table A component for displaying rows and columns
(uitable) of data.
Text Area A component for entering multiple lines of
(uitextarea) text.
© 2025 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible 3
website, in whole or in part.