Preface to MATLAB 6 for Engineers Preface to MATLAB 5 for Engineers Preface to MATLAB for Engineers
1 MATLAB in a nutshell
1.1Desktop calculations
1.1.1 Getting started
1.1.2 Arithmetic operations
1.1.3 Last-line editing
1.1.4 A few built-in functions
1.1.5 Naming constants and variables
1.1.6 Format
1.1.7 Diary
1.2One-dimensional arrays and graphics
1.2.1 Arrays - elementary operations
1.2.2 More operations on arrays
1.2.3 Row vectors and column vectors
1.2.4 The scalar product
1.2.5 Simple plots
1.3Matrices
1.3.1 Defining a matrix
1.3.2 Elementary operations with matrices
1.3.3 Printing a table
1.4Complex numbers
1.4.1 Complex numbers - elementary operations .
1.4.2 Two notes on the use of i and j
1.4.3 Plotting a complex number
1.4.4 Trigonometric and exponential representations
1.4.5 Functions of complex variables
1.4.6 Arrays of complex numbers
1.5Systems of linear equations
1.5.1 Determinants
1.5.2 Cramer\'s rule
1.5.3 Matrix inversion
1.5.4 Solving systems of linear equations in MATLAB
1.6Polynomials
1.6.1 Polynomial roots
1.6.2 Retrieving polynomial coefficients from polynomial roots
1.6.3 Polynomial evaluation
1.6.4 Multiplication and division of polynomials
1.7Programming in MATLAB
1.7.1 Programming a function
1.7.2 Repetitive control structures - FOR loops
1.7.3 Conditional control structures
1.7.4 Repetitive control structures - WHILE loops
1.8External files and programs
1.8.1 Saving and loading data
1.8.2 The CUMSUM and DIFF functions
1.8.3 Reading data from external files
1.8.4 Issuing commands to the operating system
1.8.5 Writing output to external files
1.9Regression and interpolation
1.9.1 Tables with one entry
1.9.2 Tables with two entries
1.9.3 Polynomial fit and polynomial interpolation
1.9.4 Spline interpolation
1.10More about plotting
1.10.1 Function evaluation
1.10.2 Histograms
1.10.3 Polar plots
1.10.4 A more elaborate polar plot
1.10.5 Three-dimensional plots
1.11More about interpolation and 3D plots
1.11.1 More interpolating functions
1.11.2 The GRIDDATA function and 3D plots
1.11.3 The plot of a 3D line
1MATLAB - AN INTRODUCTION FOR ENGINEERS
2Desktop calculations with graphics
2.1 Introduction
2.2 Computer-aided mistakes
2.3 Computer representation of numbers
2.4 Roundoff
2.5 Roundoff errors
2.6 The set of machine numbers
2.7 Vectors
2.8 Column vectors
2.9 A spreadsheet
2.10 Geometrical significance of the scalar product
2.11 Graphical solution of equations
2.12 Summary
2.13 Examples
2.14 Exercises
2.15 Appendix - a note on Fourier series
3 Two-dimensional arrays and matrices
3.1 Building a matrix out of vectors
3.2 Vector-by-matrix multiplication
3.3 Matrix-by-matrix multiplication
3.4 Array division
3.5 Matrix addition
3.6 Multidimensional arrays
3.7 Summary
3.8 Examples
3.9 Exercises
3.10 Where to find more examples and exercises
4 Complex numbers
4.1 Introduction
4.2 The introduction of complex numbers
4.3 Operations with complex numbers
4.4 Geometric representation
4.5 Trigonometric representation
4.6 Functions of complex variables
4.7 Mapping by functions of complex variables
4.8 Conformal mapping
4.9 Harmonic motion - phasors
4.10 A simple MATLAB program - visualizing a rotating vector
4.11 Summary
4.12 Examples
4.13 Exercises
4.14 Where to find more examples
4.15 Appendix

4.15.1 Operations with complex numbers
4.15.2 AC circuits - phasors in electrical engineering
5 Geometric calculation
5.1 Introduction
5.2 Rotation of coordinate axes in the plane
5.3 Matrix inversion
5.4 Programming a function
5.5 Euler\'s angles
5.6 Determinants
5.7 Summary
5.8 Affine transformations
5.9 Inverse affine transformations
5.10 Bezier curves - subfunctions .
5.11 Examples
5.12 Exercises
6 Solving equations
6.1 Systems of linear equations - introduction . . .
6.2 Inhomogeneous linear equations
6.3 Homogeneous linear equations
6.4 MATLAB\'s solution of linear systems
6.5 Overdetermined systems - least-squares solution
6.6 Ill-conditioned systems
6.7 Polynomial equations - introduction
6.8 Finding roots of polynomials in MATLAB . . .
6.9 Retrieving polynomial coefficients from roots . .
6.10 Summary
6.11 Examples - linear equations
6.12 Examples - polynomial equations
6.13 Exercises
6.14 Appendix - least squares fit
7Programming in MATLAB
7.1 Introduction
7.2 Conditional branching
7.3 WHILE loops
7.4 Iterative solution of equations
7.5 The Newton-Raphson method
7.6 Recursion
7.7 A note on complexity
7.8 The logistic map
7.9 Summary
7.10 Examples
7.11 Exercises
7.12 Appendix - the contractive Lipschitz condition
8External files
8.1 Introduction
8.2 A log-book of calculations
8.3 Reading data from M-files
8.4 Linear interpolation
8.4.1 Tables with one entry
8.4.2 Tables with two entries
g.5 Switching to the operating system
8.6 Writing output to external files
8.7 Exchanging data with Excel

8.7.1 Exporting data from MATLAB to Excel .
8.7.2 Importing data from Excel into MATLAB

8.8 Additional input/output functions
8.9 Summary
8.10 Examples
8.11 Exercises
9 Regression and interpolation
9.1 Introduction
9.2 Polynomial fit
9.3 Polynomial interpolation
9.4 Assessing the quality of a regression
9.5 Power regression
9.6 Exponential regression
9.7 Spline interpolation
9.8 The basic fitting interface
9.9 Summary
9.10 Examples
9.11 Exercises
10 More about plotting
10.1 Introduction
10.2 Histograms
10.3 Polar plots
10.4 Three-dimensional plots
10.5 Animation
10.6 Additive colour mixing
10.7 Handle graphics

10.7.1 Introduction
10.7.2 Slide prepared with handle graphics
10.7.3 Lighting and rendering

10.8 Examples
10.9 Exercises
10.10 Appendix - the equation of orbits of planets and satellites
ft MORE APPLICATIONS
*1 Numerical integration
H.l Introduction
11.2 The trapezoidal rule
11.3 Error of integration by the trapezoidal rule
11.4 Simpson\'s rule
11.5 Error of integration by Simpson\'s rule
11.6 MATLAB quadrature functions - function handles
11.7 Examples
11.8 Exercises
12 Graph theory
12.1 Definitions
12.2 Graph of a railway network
12.3 Sparse matrix
12.4 MATLAB 5 new features .
12.5 Exercises
13 Dimensional analysis
13.1 Introduction
13.2 Dimensional analysis
13.3 Examples
13.4 Summary
13.5 Exercises
14System modelling and simulation
14.1 Introduction
14.2 Five ways of modelling dynamic systems

14.2.1 Transfer functions
14.2.2 Zero-pole-gain models
14.2.3 Partial fractions
14.2.4 State space
14.2.5 Cauchyform
14.3Numerical solution of ordinary differential equations
14.3.1 Specifying the times of the solution
14.3.2 Using alternative odesolvers
14.3.3 Passing parameters to the model
14.4Alternative strategies to solve ordinary differential equations
14.4.1 Runge-Kutta methods
14.4.2 Predictor-corrector methods
14.4.3 Stiff systems

14.5 Conclusion: how to choose the odesolver
14.6 Exercises
15Control
15.1 Introduction
15.2 Root locus design
15.3 Design in the frequency domain
15.4 Optimal design
15.5 Exercises
16 Signal processing
16.1 Signals and signal processing
16.2 The FILTER function
16.3 Calling the filter with initial conditions
16.4 Design of digital filters

16.4.1 Definitions
16.4.2 Defining the frequency characteristics of the filter
16.4.3 The Tustin bilinear transformation

16.5 The Discrete Fourier Transform
16.6 A short introduction to the DFT
16.7 The power spectrum
16.8 Trigonometric expansion of a signal
16.9 High frequency signals and aliasing
16.10 Exercises
17 Case studies in mechanical engineering
17.1 Bending moment caused by a moving vehicle
17.2 One-dimensional heat conduction
17.3 Using a sparse matrix
17.4 Operations on unit-affected quantities

17.4.1 Introduction
17.4.2 Transition tables
17.4.3 Multiplication
17.4.4 Electrical units
17.5Exercises
18 Advanced features
18.1 Introduction
18.2 Structures

18.2.1 Where structures can help
18.2.2 Working with structures

18.3 Cell arrays
18.4 Conversions

18.4.1 Numerical to cell array
18.4.2 Cell array of numbers to numerical array
18.4.3 Structure to cell array
18.4.4 Cell array to structure
18.4.5 Numerical field of structure to numerical array
18.4.6 Numerical array to numerical field of structure

18.5 Functions with variable number of input/output arguments
18.6 GUIs

18.6.1 What are GUIs?
18.6.2 A simple example
18.6.3 A GUI for additive colour mixing

18.7 A word on object-oriented programming
18.8 Example - querying a cell array