(eBook PDF) Essentials of MATLAB Programming 3rd Editiondownload
(eBook PDF) Essentials of MATLAB Programming 3rd Editiondownload
https://ebookmass.com/product/ebook-pdf-essentials-of-matlab-
programming-3rd-edition/
https://ebookmass.com/product/essentials-of-torts-3rd-edition-ebook-
pdf-version/
https://ebookmass.com/product/matlab-programming-for-engineers-6th-
edition-stephen-j-chapman/
https://ebookmass.com/product/corrections-the-essentials-3rd-edition-
ebook-pdf/
https://ebookmass.com/product/ebook-pdf-essentials-of-sociology-3rd-
edition-by-george-ritzer/
The ASAM Essentials of Addiction Medicine 3rd Edition,
(Ebook PDF)
https://ebookmass.com/product/the-asam-essentials-of-addiction-
medicine-3rd-edition-ebook-pdf/
https://ebookmass.com/product/essentials-of-public-health-essential-
public-health-3rd-edition-ebook-pdf/
https://ebookmass.com/product/matlab-a-practical-introduction-to-
programming-and-problem-solving-4th-edition-stormy-attaway/
https://ebookmass.com/product/the-essentials-of-risk-management-3rd-
edition-michel-crouhy/
ESSENTIALS OF ESSENTIALS OF
CHAPMAN
MATLAB
PROGRAMMING
MATLAB
PROGRAMMING
ESSENTIALS OF
STEPHEN J. CHAPMAN STEPHEN J. CHAPMAN
THIRD EDITION
MATLAB
PROGRAMMING
To register or access your online learning solution or purchase materials
for your course, visit www.cengagebrain.com.
3E
THIRD EDITION
Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
Preface | vii
Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
viii | Preface
4. Device-independent plotting.
Unlike other computer languages, MATLAB has many integral plot-
ting and imaging commands. The plots and images can be displayed
on any graphical output device supported by the computer on which
MATLAB is running. This capability makes MATLAB an outstanding
tool for visualizing technical data.
5. Graphical user interface.
MATLAB includes tools that allow a programmer to interactively con-
struct a graphical user interface (GUI) for his or her program. With
this capability, the programmer can design sophisticated data analysis
programs that can be operated by relatively inexperienced users.
Pedagogical Features
This book is specifically designed to be used in a first-year “Introduction to
Programming/Problem Solving” course. It should be possible to cover this material
comfortably in a 9-week, 3-hour-per-week course. If there is insufficient time to
cover all of the material in a particular engineering program, Chapters 8 and 9
may be deleted, and the remaining material will still teach the fundamentals of
programming and using MATLAB to solve problems. This feature should ap-
peal to harassed engineering educators trying to cram ever more material into a
finite curriculum.
The book includes several features designed to aid student comprehension.
A total of 14 quizzes appear scattered throughout the chapters, with answers
to all questions included in Appendix C. These quizzes can serve as a useful
self-test of comprehension. In addition, there are approximately 150 end-of-
chapter exercises. Answers to all exercises are included in the Instructor’s Man-
ual. Good programming practices are highlighted in all chapters with special
Good Programming Practice boxes, and common errors are highlighted in Pro-
gramming Pitfalls boxes. End-of-chapter materials include Summaries of Good
Programming Practice and Summaries of MATLAB Commands and Functions.
Instructor Resources
A detailed Instructor’s Solutions Manual containing solutions to all end-of-
chapter exercises is available via the secure, password-protected Instructor
Resource Center at https://sso.cengage.com. The Instructor Resource Center
also contains helpful Lecture Note PowerPoint slides, the MATLAB source code
for all examples in the book, and the source code for all of the solutions in the
Instructor’s Solutions Manual.
Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
Preface | ix
Acknowledgments
I would like to thank these reviewers who offered their helpful suggestion for
this edition:
David Eromom Georgia Southern University
Arlene Guest Naval Postgraduate School
Mary M. Hofle Idaho State University
Mark Hutchenreuther California Polytechnic State
University
Mani Mini Iowa State University
In addition I would like to acknowledge and thank my Global Engineering team
at Cengage Learning for their dedication to this edition:
Timothy Anderson, Product Director; Mona Zeftel, Senior Content Developer;
D. Jean Buttrom, Content Project Manager; Kristin Stine, Marketing Manager;
Elizabeth Murphy and Brittany Burden, Learning Solutions Specialists; Ashley
Kaupert, Associate Media Content Developer; Teresa Versaggi and Alexander
Sham, Product Assistants; and Rose Kernan of RPK Editorial Services, Inc.
They have skillfully guided every aspect of this text’s development and produc-
tion to successful completion.
In addition, I would like to thank my wife Rosa for her help and encourage-
ment over the more than 40 years we have spent together.
Stephen J. Chapman
Melbourne, Australia
November 8, 2015
Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
MindTap Online Course
Index 479
Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
Chapter 1
Introduction to MATLAB
1
Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
2 | Chapter 1 Introduction to MATLAB
the scientist or engineer how to use MATLAB’s own tools to locate the right func-
tion for a specific purpose from the enormous list of choices available. In addition,
it teaches how to use MATLAB to solve many practical engineering problems, such
as vector and matrix algebra, curve fitting, differential equations, and data plotting.
The MATLAB program is a combination of a procedural programming language,
an integrated development environment (IDE) including an editor and debugger, and
an extremely rich set of functions to perform many types of technical calculations.
The MATLAB language is a procedural programming language, meaning that the
engineer writes procedures, which are effectively mathematical recipes for solving a
problem. This makes MATLAB very similar to other procedural languages such as C,
Basic, Fortran, and Pascal. However, the extremely rich list of predefined functions
and plotting tools makes it superior to these other languages for many engineering
analysis applications.
The second disadvantage is cost: a full copy of MATLAB is five to ten times
more expensive than a conventional C or Fortran compiler. This relatively high
cost is more than offset by the reduced time required for an engineer or scientist
to create a working program, so MATLAB is cost-effective for businesses. How-
ever, it is too expensive for most individuals to consider purchasing. Fortunately,
there is also an inexpensive student edition of MATLAB, which is a great tool
for students wishing to learn the language. The student edition of MATLAB is
essentially identical to the full edition.1
1
There are also some free software programs that are largely compatible with MATLAB, such as
GNU Octave and FreeMat.
Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
1.3 The MATLAB Environment | 5
Current Folder
This control allow
Browser
a user to view Launch the MATLAB
shows a list
or change the Help Browser Editor
of the files in the
current directory
current directory
Details Window
displays the Workspace Browser
MATLAB Command
properties of a file shows variables defined
Window
selected in the in workspace
Current Folder Browser
Figure 1.1 The default MATLAB desktop. The exact appearance of the desktop
may differ slightly on different types of computers.
The major tools within or accessible from the MATLAB desktop are:
■ Command Window
■ Toolstrip
■ Documents Window, including the Editor/Debugger and Array Editor
■ Figure Windows
■ Workspace Browser
■ Current Folder Browser, with the Details Window
■ Help Browser
■ Path Browser
■ Popup Command History Window
Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
6 | Chapter 1 Introduction to MATLAB
The functions of these tools are summarized in Table 1.1. We will discuss
them in later sections of this chapter.
Result is added
to the workspace
User input
Result of
calculation
Figure 1.2 The Command Window appears in the center of the desktop.
Users enter commands and see responses here.
1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside
the United States, check the laws of your country in addition to
the terms of this agreement before downloading, copying,
displaying, performing, distributing or creating derivative works
based on this work or any other Project Gutenberg™ work. The
Foundation makes no representations concerning the copyright
status of any work in any country other than the United States.
1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if
you provide access to or distribute copies of a Project
Gutenberg™ work in a format other than “Plain Vanilla ASCII” or
other format used in the official version posted on the official
Project Gutenberg™ website (www.gutenberg.org), you must,
at no additional cost, fee or expense to the user, provide a copy,
a means of exporting a copy, or a means of obtaining a copy
upon request, of the work in its original “Plain Vanilla ASCII” or
other form. Any alternate format must include the full Project
Gutenberg™ License as specified in paragraph 1.E.1.
• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.
1.F.
ebookmasss.com