Matlab: A Practical Introduction to Programming and Problem Solving, Second Edition

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

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)

Author(s): Stormy Attaway
Edition: 2nd
Publisher: Butterworth-Heinemann
Year: 2011

Language: English
Pages: 524
Tags: Библиотека;Компьютерная литература;Matlab / Simulink;

Cover Page......Page 1
Title Page
......Page 2
Copyright Page......Page 3
Dedication......Page 4
CONTENTS......Page 5
Motivation......Page 8
Systematic Approach......Page 9
Problem-Solving Tools......Page 10
Layout of Text......Page 11
Pedagogical Features......Page 14
Additional Book Resources......Page 15
Acknowledgments......Page 16
1 Introduction to MATLAB......Page 18
1.1 Getting into MATLAB......Page 19
1.2 The MATLAB Desktop Environment......Page 20
Reading from files......Page 21
Initializing, incrementing, and decrementing......Page 23
Variable names......Page 24
For loops that do not use the iterator variable in the action......Page 140
The format function and ellipsis......Page 25
Operators......Page 26
Operator precedence rules......Page 27
Vector operations......Page 388
Types......Page 30
Random numbers......Page 32
1.5 Characters and Encoding......Page 34
1.6 Vectors and Matrices......Page 36
The colon operator and linspace function......Page 37
Referring to and modifying elements......Page 38
Creating matrix variables......Page 40
Referring to and modifying matrix elements......Page 42
Dimensions......Page 44
Changing dimensions......Page 46
Using functions with vectors and matrices......Page 49
Empty vectors......Page 50
Three-dimensional matrices......Page 52
Summary......Page 53
2 Introduction to MATLAB Programming......Page 59
4.1 The For Loop......Page 130
14.2 Image Processing......Page 61
2.3 Input and Output......Page 63
Input Function......Page 64
Output statements: disp and fprintf......Page 66
Printing vectors and matrices......Page 69
2.4 Scripts with Input and Output......Page 71
The plot function......Page 72
Customizing a plot: color, line types, marker types......Page 74
Simple related plot functions......Page 75
2.6 Introduction to File Input/Output (Load and Save)......Page 77
Writing data to a file......Page 78
Reading from a file......Page 79
Example: Load from a file and plot the data......Page 80
2.7 User-Defined Functions That Return a Single Value......Page 82
Function definitions......Page 83
Calling a function......Page 85
Passing multiple arguments......Page 86
Error-checking user input in a while loop......Page 159
Functions with local variables......Page 88
Summary......Page 89
3.1 Relational Expressions......Page 97
3.2 The if Statement......Page 101
Representing logical true and false......Page 104
3.3 The If-else Statement......Page 105
3.4 Nested if-Else Statements......Page 107
The elseif clause......Page 108
3.5 The switch statement......Page 112
3.6 The menu function......Page 114
3.7 The ``is´´ functions in MATLAB......Page 116
Summary......Page 119
4 Loop Statements......Page 129
Finding sums and products......Page 131
Sums and products with vectors......Page 133
Preallocating a vector......Page 137
Combining for loops with if statements......Page 139
Complex equations represented as polynomials......Page 491
Displaying expressions......Page 142
Nested loops and matrices......Page 147
Combining nested for loops and if statements......Page 151
4.3 While Loops......Page 153
Reading from a file in a while loop......Page 155
Input in a while loop......Page 156
Counting in a while loop......Page 157
Error-checking for integers......Page 160
Summary......Page 162
5.1 Loops with Vectors and Matrices......Page 169
5.2 Operations on Vectors and Matrices......Page 170
5.3 Vectors and Matrices as Function Arguments......Page 173
5.4 Logical Vectors......Page 174
Logical built-in functions......Page 177
5.5 Vectorizing Code......Page 180
5.6 Timing......Page 185
Summary......Page 186
6 MATLAB Programs......Page 191
Opening and closing a file......Page 290
Creating cell arrays......Page 192
Functions that accomplish a task without returning values......Page 196
Passing structures to functions......Page 197
Passing arguments to functions......Page 198
Modular programs......Page 200
Subfunctions......Page 203
6.3 Application: Menu-Driven Modular Program......Page 205
6.4 Variable Scope......Page 211
Plotting from a function......Page 360
Types of errors......Page 216
Tracing......Page 217
Editor/Debugger......Page 218
Function stubs......Page 219
Summary......Page 220
7.1 Creating String Variables......Page 228
Strings as vectors......Page 229
Concatenation......Page 231
Creating customized strings......Page 233
Applications of customized strings: prompts, labels, arguments to functions......Page 234
Removing white space characters......Page 237
Changing case......Page 238
Sorting strings......Page 425
Finding, replacing, and separating strings......Page 241
Evaluating a string......Page 246
7.4 Converting Between String and Number Types......Page 247
Summary......Page 251
8 Data Structures: Cell Arrays and Structures......Page 258
8.1 Cell Arrays......Page 259
Referring to and displaying cell array elements and attributes......Page 260
Storing strings in cell arrays......Page 263
Creating and modifying structure variables......Page 265
Related structure functions......Page 269
Vectors of structures......Page 270
Nested structures......Page 277
Vectors of nested structures......Page 279
Summary......Page 281
9 Advanced File Input and Output......Page 289
Comparison of input file functions......Page 298
Writing to files......Page 301
9.2 Writing and reading spreadsheet files......Page 303
Writing variables to a file......Page 305
Reading from a MAT-file......Page 306
Summary......Page 307
10.1 Anonymous Functions......Page 313
Function functions......Page 315
Variable number of input arguments......Page 318
Variable number of output arguments......Page 321
10.4 Nested Functions......Page 324
10.5 Recursive Functions......Page 325
Summary......Page 330
11.1 Plot Functions......Page 336
Polynomials......Page 337
Plot types......Page 338
11.2 Animation......Page 343
11.3 Three-Dimensional Plots......Page 344
11.4 Customizing Plots......Page 348
Plot objects and properties......Page 350
Core objects......Page 353
Plotting file data......Page 362
Summary......Page 365
12 Matrix Representation of Linear Algebraic Equations......Page 376
Matrix properties......Page 377
Square matrices......Page 378
Array operations......Page 383
Matrix multiplication......Page 384
Matrix operations......Page 386
Dot product and cross product......Page 389
12.2 Matrix Solutions to Systems of Linear Algebraic Equations......Page 390
Solving 2 x 2 systems of equations......Page 392
Gauss and Gauss-Jordan elimination......Page 395
Gauss elimination......Page 396
Gauss-Jordan elimination......Page 398
Finding a matrix inverse by reducing an augmented matrix......Page 401
Summary......Page 402
13 Basic Statistics, Sets, Sorting, and Indexing......Page 409
13.1 Statistical Functions......Page 410
Mean......Page 411
Variance and standard deviation......Page 414
Mode......Page 415
13.2 Set Operations......Page 416
13.3 Sorting......Page 420
Sorting vectors of structures......Page 423
13.4 Index Vectors......Page 427
Indexing into vectors of structures......Page 429
13.5 Searching......Page 430
Sequential search......Page 431
Binary search......Page 432
Summary......Page 435
14.1 Sound Files......Page 442
Colormaps......Page 445
True color matrices......Page 450
14.3 Introduction to Graphical User Interfaces......Page 453
Summary......Page 470
15.1 Fitting Curves to Data......Page 479
Interpolation and extrapolation......Page 481
Least squares......Page 484
15.2 Complex Numbers......Page 487
Equality for complex numbers......Page 489
Adding and subtracting complex numbers......Page 490
Polar form......Page 492
Plotting......Page 493
15.3 Symbolic Mathematics......Page 494
Symbolic variables and expressions......Page 495
Simplification functions......Page 496
Solving equations......Page 498
Integration and the trapezoidal rule......Page 501
Differentiation......Page 503
Calculus in Symbolic Math Toolbox......Page 504
Summary......Page 505
C......Page 517
F......Page 518
I......Page 519
L......Page 520
P......Page 521
S......Page 522
U......Page 523
Z......Page 524