Assuming no knowledge of programming, this book presents both programming concepts and MATLAB's built-in functions, providing a perfect platform for exploiting MATLAB's extensive capabilities for tackling engineering problems. It starts with programming concepts such as variables, assignments, input/output, and selection statements, moves onto loops and then solves problems using both the 'programming concept' and the 'power of MATLAB' side-by-side. In-depth coverage is given to input/output, a topic that is fundamental to many engineering applications. Ancillaries available with the text: Instructor solution manual (available Aug. 1st) electronic images from the text (available Aug 16th) m-files (available Aug 1st)* Presents programming concepts and MATLAB built-in functions side-by-side, giving students the ability to program efficiently and exploit the power of MATLAB to solve problems. * In depth coverage of file input/output, a topic essential for many engineering applications * Systematic, step-by-step approach, building on concepts throughout the book, facilitating easier learning * Sections on 'common pitfalls' and 'programming guidelines' direct students towards best practice * New to this edition: More engineering applications help the reader learn Matlab in the context of solving technical problems New and revised end of chapter problems Stronger coverage of loops and vectorizing in a new chapter, chapter 5 Updated to reflect current features and functions of the current release of Matlab
Author(s): Stormy Attaway
Edition: 2
Publisher: Butterworth-Heinemann
Year: 2011
Language: English
Commentary: TOC missing
Pages: 522
Cover
......Page 1
Title
......Page 2
Copyright......Page 4
Dedication......Page 5
Motivation......Page 6
Systematic Approach......Page 7
Problem-Solving Tools......Page 8
Layout of Text......Page 9
Pedagogical Features......Page 12
Additional Book Resources......Page 13
Acknowledgments......Page 14
Introduction to MATLAB......Page 16
Getting into MATLAB......Page 17
Image Processing......Page 442
Variables and Assignment Statements......Page 19
Initializing, incrementing, and decrementing......Page 21
Variable names......Page 22
Expressions......Page 23
Comparison of input file functions......Page 235
Operators......Page 24
Operator precedence rules......Page 25
Built-in functions and help......Page 26
Types......Page 28
Random numbers......Page 30
Characters and Encoding......Page 32
Vectors and Matrices......Page 34
The colon operator and linspace function......Page 35
Referring to and modifying elements......Page 36
Creating matrix variables......Page 38
Referring to and modifying matrix elements......Page 40
Dimensions......Page 42
Changing dimensions......Page 44
Using functions with vectors and matrices......Page 47
Empty vectors......Page 48
Three-dimensional matrices......Page 50
Summary......Page 51
Introduction to MATLAB Programming......Page 57
Algorithms......Page 58
MATLAB Scripts......Page 59
Input and Output......Page 61
Input Function......Page 62
Output statements: disp and fprintf......Page 64
Printing vectors and matrices......Page 67
Scripts with Input and Output......Page 69
The plot function......Page 70
Customizing a plot: color, line types, marker types......Page 72
Simple related plot functions......Page 73
Introduction to File Input/Output (Load and Save)......Page 75
Writing data to a file......Page 76
Reading from a file......Page 77
Example: Load from a file and plot the data......Page 78
User-Defined Functions That Return a Single Value......Page 80
Function definitions......Page 81
Calling a function......Page 83
Passing multiple arguments......Page 84
Functions with local variables......Page 86
Summary......Page 87
Relational Expressions......Page 95
The if Statement......Page 99
Representing logical true and false......Page 102
The If-else Statement......Page 103
Nested if-Else Statements......Page 105
Vectors of structures......Page 268
The switch statement......Page 110
The menu function......Page 112
The ``is´´ functions in MATLAB......Page 114
Summary......Page 117
Loop Statements......Page 127
The For Loop......Page 128
Finding sums and products......Page 129
Sums and products with vectors......Page 131
Preallocating a vector......Page 135
Sorting vectors of structures......Page 175
Input in a for loop......Page 138
Nested For Loops......Page 140
Nested loops and matrices......Page 145
Combining nested for loops and if statements......Page 149
While Loops......Page 151
Reading from a file in a while loop......Page 153
Input in a while loop......Page 154
Counting in a while loop......Page 155
Error-checking user input in a while loop......Page 157
Error-checking for integers......Page 158
Summary......Page 160
Vectorized Code......Page 167
Matrix Definitions......Page 288
Operations on Vectors and Matrices......Page 168
Vectors and Matrices as Function Arguments......Page 171
True color matrices......Page 172
Vectorizing Code......Page 178
Timing......Page 183
Summary......Page 184
Statistical Functions......Page 189
Functions that return more than one value......Page 190
Complex Numbers......Page 194
Functions that return values versus printing......Page 195
Passing arguments to functions......Page 196
Modular programs......Page 198
Subfunctions......Page 201
Application: Menu-Driven Modular Program......Page 203
Variable Scope......Page 209
Persistent variables......Page 211
Types of errors......Page 214
Tracing......Page 215
Editor/Debugger......Page 216
Function stubs......Page 217
Summary......Page 218
Creating String Variables......Page 226
Polynomials......Page 227
Function functions......Page 229
Structures......Page 231
Applications of customized strings: prompts, labels, arguments to functions......Page 232
Changing case......Page 236
Comparing strings......Page 237
Finding, replacing, and separating strings......Page 239
Evaluating a string......Page 244
Converting Between String and Number Types......Page 245
Summary......Page 249
Data Structures: Cell Arrays
and Structures......Page 256
Cell Arrays......Page 257
Referring to and displaying cell array elements and attributes......Page 258
Variable number of input arguments......Page 316
Creating and modifying structure variables......Page 263
Passing structures to functions......Page 266
Related structure functions......Page 267
Nested structures......Page 275
Vectors of nested structures......Page 277
Summary......Page 279
Advanced File Input and Output......Page 287
Reading from files......Page 289
Writing to files......Page 299
Writing and reading spreadsheet files......Page 301
Writing variables to a file......Page 303
Reading from a MAT-file......Page 304
Summary......Page 305
Anonymous Functions......Page 311
Uses of Function Handles......Page 313
Variable number of output arguments......Page 319
Nested Functions......Page 322
Recursive Functions......Page 323
Summary......Page 328
Plot Functions......Page 334
Matrix of plots......Page 335
Plot types......Page 336
Animation......Page 341
Three-Dimensional Plots......Page 342
Customizing Plots......Page 346
Plot objects and properties......Page 348
Core objects......Page 351
Plotting from a function......Page 358
Plotting file data......Page 360
Summary......Page 363
Matrix Representation of Linear Algebraic Equations......Page 374
Square matrices......Page 376
Array operations......Page 381
Matrix multiplication......Page 382
Matrix operations......Page 384
Complex conjugate and absolute value......Page 386
Dot product and cross product......Page 387
Matrix Solutions to Systems of Linear Algebraic Equations......Page 388
Solving 2 x 2 systems of equations......Page 390
Gauss and Gauss-Jordan elimination......Page 393
Gauss elimination......Page 394
Gauss-Jordan elimination......Page 396
Finding a matrix inverse by reducing an augmented matrix......Page 399
Summary......Page 400
Basic Statistics, Sets, Sorting, and Indexing......Page 407
Mean......Page 409
Variance and standard deviation......Page 412
Mode......Page 413
Set Operations......Page 414
Sorting......Page 418
Sorting strings......Page 423
Index Vectors......Page 425
Indexing into vectors of structures......Page 427
Searching......Page 428
Sequential search......Page 429
Binary search......Page 430
Sound Files......Page 440
Colormaps......Page 443
Introduction to Graphical User Interfaces......Page 451
Summary......Page 468
Fitting Curves to Data......Page 477
Interpolation and extrapolation......Page 479
Least squares......Page 482
Equality for complex numbers......Page 487
Adding and subtracting complex numbers......Page 488
Complex equations represented as polynomials......Page 489
Polar form......Page 490
Plotting......Page 491
Symbolic Mathematics......Page 492
Symbolic variables and expressions......Page 493
Simplification functions......Page 494
Solving equations......Page 496
Integration and the trapezoidal rule......Page 499
Differentiation......Page 501
Calculus in Symbolic Math Toolbox......Page 502
Summary......Page 503
C......Page 515
F......Page 516
I......Page 517
L......Page 518
P......Page 519
S......Page 520
U......Page 521
Z......Page 522