Matlab a practical introduction to programming and problem solving 3e edition Edition Attaway instant download
Matlab a practical introduction to programming and problem solving 3e edition Edition Attaway instant download
https://ebookname.com/product/matlab-a-practical-introduction-to-
programming-and-problem-solving-3e-edition-edition-attaway/
https://ebookname.com/product/java-an-introduction-to-problem-
solving-and-programming-6th-edition-walter-savitch/
https://ebookname.com/product/programming-problem-solving-
abstraction-with-c-moffat/
https://ebookname.com/product/problem-solving-and-programming-
concepts-9th-edition-maureen-sprankle/
https://ebookname.com/product/writing-chinese-laws-the-form-and-
function-of-legal-statutes-found-in-the-qin-shuihudi-corpus-1st-
edition-ernest-caldwell/
Highland Sanctuary Environmental History in Tanzania s
Usambara Mountains 1st Edition Christopher A. Conte
https://ebookname.com/product/highland-sanctuary-environmental-
history-in-tanzania-s-usambara-mountains-1st-edition-christopher-
a-conte/
https://ebookname.com/product/oxford-companion-to-
consciousness-1st-edition-tim-bayne/
https://ebookname.com/product/handbook-of-violence-risk-
assessment-2nd-edition-kevin-douglas/
https://ebookname.com/product/achieving-market-integration-1st-
edition-scott-mccleskey/
https://ebookname.com/product/ordinary-television-analyzing-
popular-tv-1st-edition-dr-frances-bonner/
South The Story of Shackleton s Last Expedition 1914 17
Sir Ernest Henry Shackleton
https://ebookname.com/product/south-the-story-of-shackleton-s-
last-expedition-1914-17-sir-ernest-henry-shackleton/
MATLABÒ
A Practical Introduction to Programming
and Problem Solving
This page intentionally left blank
MATLAB Ò
A Practical Introduction to Programming
and Problem Solving
Third Edition
Stormy Attaway
Department of Mechanical Engineering,
Boston University
PREFACE ...................................................................................................... xi
ACKNOWLEDGMENTS............................................................................. xxi
MOTIVATION
The purpose of this book is to teach basic programming concepts and skills
needed for basic problem solving, all using MATLABÒ as the vehicle. MATLAB is
a powerful software package that has built-in functions to accomplish a diverse
range of tasks, from mathematical operations to three-dimensional imaging.
Additionally, MATLAB has a complete set of programming constructs that
allows users to customize programs to their own specifications.
There are many books that introduce MATLAB. There are two basic flavors of
these books: those that demonstrate the use of the built-in functions in
MATLAB, with a chapter or two on some programming concepts, and those
that cover only the programming constructs without mentioning many of the
built-in functions that make MATLAB efficient to use. Someone who learns
just the built-in functions will be well prepared to use MATLAB, but would
not understand basic programming concepts. That person would not be able
to then learn a language such as C++ or Java without taking another intro-
ductory course, or reading another book, on the programming concepts.
Conversely, anyone who learns only programming concepts first (using any
language) would tend to write highly inefficient code using control statements
to solve problems, not realizing that in many cases these are not necessary in
MATLAB.
Instead, this book takes a hybrid approach, introducing both the programming
and the efficient uses. The challenge for students is that it is nearly impossible to
predict whether they will, in fact, need to know programming concepts later on
or whether a software package such as MATLAB will suffice for their careers.
Therefore, the best approach for beginning students is to give them both: the
programming concepts and the efficient built-in functions. As MATLAB is very
easy to use, it is a perfect platform for this approach to teaching programming
and problem solving.
xi
xii Preface
matrices
n plot functions, including those that use logarithmic scales
some functions and operators on vectors and matrices, and prepares for
vectorizing code
n matrix multiplication covered much earlier (in Chapter 2)
n vectorized code covered in the loop chapter in order to compare the use
KEY FEATURES
Side-by-Side Programming Concepts and Built-in
Functions
The most important, and unique, feature of this book is that it teaches
programming concepts and the use of the built-in functions in MATLAB side-
by-side. It starts with basic programming concepts, such as variables,
Preface xiii
Systematic Approach
Another key feature is that the book takes a very systematic, step-by-step
approach, building on concepts throughout the book. It is very tempting in
a MATLAB text to show built-in functions or features early on with a note that
says “we’ll do this later”. This book does not do that; functions are covered
before they are used in examples. Additionally, basic programming concepts
will be explained carefully and systematically. Very basic concepts, such as
looping to calculate a sum, counting in a conditional loop, and error-checking,
are not found in many texts, but are covered here.
File Input/Output
Many applications in engineering and the sciences involve manipulating large
data sets that are stored in external files. Most MATLAB texts at least mention
the save and load functions, and, in some cases, also some of the lower-level
file input/output functions. As file input and output are so fundamental to so
many applications, this book will cover several low-level file input/output
functions, as well as reading from and writing to spreadsheet files. Later
chapters will also deal with audio and image files. These file input/output
concepts are introduced gradually: first load and save in Chapter 3, then lower-
level functions in Chapter 9, and, finally, sound and images in Chapter 13.
User-Defined Functions
User-defined functions are a very important programming concept, and yet
many times the nuances and differences between concepts, such as types of
functions and function calls versus function headers, can be very confusing to
beginner programmers. Therefore, these concepts are introduced gradually.
First, arguably the easiest type of functions to understand, those that calculate
and return one single value, are demonstrated in Chapter 3. Later, functions
that return no values and functions that return multiple values are introduced
in Chapter 6. Finally, advanced function features are shown in Chapter 10.
covered. Sorting, searching, and indexing are also addressed. All of these are
again approached systematically; for example, cell arrays are covered before
they are used in file input functions and as labels on pie charts.
Problem-Solving Tools
In addition to the programming concepts, some basic mathematics necessary
for solving many problems will be introduced. These will include statistical
functions, solving sets of linear algebraic equations, and fitting curves to data.
The use of complex numbers and some calculus (integration and differentia-
tion) will also be introduced. The basic math will be explained and the built-in
functions in MATLAB to perform these tasks will be described.
Vectorized Code
Efficient uses of the capabilities of the built-in operators and functions in
MATLAB are demonstrated throughout the book. In order to emphasize the
importance of using MATLAB efficiently, the concepts and built-in functions
necessary for writing vectorized code are treated very early in Chapter 2.
Techniques such as preallocating vectors and using logical vectors are then
covered in Chapter 5 as alternatives to selection statements and looping
through vectors and matrices. Methods of determining how efficient the code is
are also covered.
LAYOUT OF TEXT
This text is divided into two parts: the first part covers programming constructs
and demonstrates the programming method versus efficient use of built-in
functions to solve problems. The second part covers tools that are used for basic
problem solving, including plotting, image processing, and mathematical
techniques to solve systems of linear algebraic equations, fit curves to data, and
perform basic statistical analyses. The first six chapters cover the very basics in
MATLAB and in programming, and are all prerequisites for the rest of the book.
After that, many chapters in the problem-solving section can be introduced,
Preface xv
when desired, to produce a customized flow of topics in the book. This is true
to an extent, although the order of the chapters has been chosen carefully to
ensure that the coverage is systematic.
The individual chapters are described here, as well as which topics are required
for each chapter.
PEDAGOGICAL FEATURES
There are several pedagogical tools that are used throughout this book that are
intended to make it easier to learn the material.
First, the book takes a conversational tone with sections called “Quick Ques-
tion!”. These are designed to stimulate thought about the material that has just
been covered. The question is posed, and then the answer is given. It will be
most beneficial to the reader to try to think about the question before reading
the answer! In any case, they should not be skipped over, as the answers often
contain very useful information.
“Practice” problems are given throughout the chapters. These are very simple
problems that drill the material just covered.
xviii Preface
“Explore Other Interesting Features”: this section has been added to the end of
every chapter in this third edition. This book is not intended to be a complete
reference book, and cannot possibly cover all of the built-in functions and tools
available in MATLAB; however, in every chapter there will be a list of functions
and/or commands that are related to the chapter topics, which readers may
wish to investigate.
When some problems are introduced, they are solved using both “The
Programming Concept” and “The Efficient Method”. This facilitates under-
standing the built-in functions and operators in MATLAB, as well as the
underlying programming concepts. “The Efficient Method” highlights methods
that will save time for the programmer, and, in many cases, are also faster to
execute in MATLAB.
Additionally, to aid the reader:
n identifier names are shown in italic
n MATLAB function names are shown in bold
n reserved words are shown in bold and underline
n key important terms are shown in bold and italic.
The end-of-chapter “Summary” contains, where applicable, several sections:
Common Pitfalls: a list of common mistakes that are made, and how to
avoid them.
Programming Style Guidelines: in order to encourage “good” programs,
that others can actually understand, the programming chapters will have
guidelines that will make programs easier to read and understand, and
therefore easier to work with and modify.
Key Terms: a list of the key terms covered in the chapter, in sequence.
MATLAB Reserved Words: a list of the reserved key words in MATLAB.
Throughout the text, these are shown in bold, underlined type.
MATLAB Functions and Commands: a list of the MATLAB built-in
functions and commands covered in the chapter, in the order covered.
Throughout the text, these are shown in bold type.
MATLAB Operators: a list of the MATLAB operators covered in the chapter,
in the order covered.
Exercises: a comprehensive set of exercises, ranging from the rote to more
engaging applications.
xxi
xxii Acknowledgments
Introduction to Programming
Using MATLAB
Discovering Diverse Content Through
Random Scribd Documents
CHAPITRE IV
OU SANCHO PANZA RÉPOND AUX QUESTIONS ET ÉCLAIRCIT LES
SOUVENANCE
CETTE HISTOIRE
DULCINÉE
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookname.com