# Essential MATLAB for Engineers and Scientists

## 5th Edition

**Authors:**Brian Hahn Daniel Valentine

**Paperback ISBN:**9780123943989

**eBook ISBN:**9780123946133

**Imprint:**Academic Press

**Published Date:**10th January 2013

**Page Count:**424

## Description

- Preface
- Part I. Essentials
- Chapter 1. Introduction
- 1.1 Using MATLAB
- 1.2 The desktop
- 1.3 Sample program
- Chapter 2. MATLAB Fundamentals
- 2.1 Variables
- 2.2 The workspace
- 2.3 Arrays: Vectors and matrices
- 2.4 Vertical motion under gravity
- 2.5 Operators, expressions, and statements
- 2.6 Output
- 2.7 Repeating with for
- 2.8 Decisions
- 2.9 Complex numbers
- Summary
- Chapter exercises
- Chapter 3. Program Design and Algorithm Development
- 3.1 The program design process
- 3.2 Programming MATLAB functions
- Summary
- Chapter exercises
- Chapter 4. MATLAB Functions and Data Import-Export Utilities
- 4.1 Common functions
- 4.2 Importing and exporting data
- Summary
- Chapter exercises
- Chapter 5. Logical vectors
- 5.1 Examples
- 5.2 Logical operators
- 5.3 Subscripting with logical vectors
- 5.4 Logical functions
- 5.5 Logical vectors instead of elseif ladders
- Summary
- Chapter exercises
- Chapter 6. Matrices and Arrays
- 6.1 Matrices
- 6.2 Matrix operations
- 6.3 Other matrix functions
- 6.4 Population growth: Leslie matrices
- 6.5 Markov processes
- 6.6 Linear equations
- 6.7 Sparse matrices
- Summary
- Chapter exercises
- Chapter 7. Function M-files
- 7.1 Example: Newton’s method again
- 7.2 Basic rules
- 7.3 Function handles
- 7.4 Command/function duality
- 7.5 Function name resolution
- 7.6 Debugging M-files
- 7.7 Recursion
- Summary
- Chapter exercises
- Chapter 8. Loops
- 8.1 Determinate repetition with series for
- 8.2 Indeterminate repetition with series while
- Summary
- Chapter exercises
- Chapter 9. MATLAB Graphics
- 9.1 Basic 2-D graphs
- 9.2 3-D plots
- 9.3 Handle Graphics
- 9.4 Editing plots
- 9.5 Animation
- 9.6 Color etc.
- 9.7 Lighting and camera
- 9.8 Saving, printing and exporting graphs
- Summary
- Chapter exercises
- Chapter 10. Vectors as Arrays and Other Data Structures
- 10.1 Update processes
- 10.2 Frequencies, bar charts, and histograms
- 10.3 Sorting
- 10.4 Structures
- 10.5 Cell arrays
- 10.6 Classes and objects
- Summary
- Chapter 11. Errors and Pitfalls
- 11.1 Syntax errors
- 11.2 Logic errors
- 11.3 Rounding error
- Summary
- Chapter exercises
- Part II. Applications
- Chapter 12. Dynamical Systems
- 12.1 Cantilever beam
- 12.2 Electric current
- 12.3 Free fall
- 12.4 Projectile with friction
- Summary
- Chapter exercises
- Chapter 13. Simulation
- 13.1 Random number generation
- 13.2 Spinning coins
- 13.3 Rolling dice
- 13.4 Bacteria division
- 13.5 A random walk
- 13.6 Traffic flow
- 13.7 Normal (Gaussian) random numbers
- Summary
- Chapter exercises
- Chapter 14. Introduction to Numerical Methods
- 14.1 Equations
- 14.2 Integration
- 14.3 Numerical differentiation
- 14.4 First-order differential equations
- 14.5 Linear ordinary differential equations (LODEs)
- 14.6 Runge-Kutta methods
- 14.7 A partial differential equation
- 14.8 Other numerical methods
- Chapter 15. Signal Processing
- 15.1 Harmonic analysis
- 15.2 Fast Fourier Transform (FFT)
- Chapter 16. SIMULINK® Toolbox
- 16.1 Mass-spring-damper dynamic system
- 16.2 Bouncing ball dynamic system
- 16.3 The van der Pol oscillator
- 16.4 The Duffing oscillator
- Chapter exercises
- Chapter 17. Symbolics Toolbox
- 17.1 Algebra
- 17.2 Calculus
- 17.3 Laplace and Z transforms
- 17.4 Generalized Functions*
- 17.5 Differential equations
- 17.6 Implementation of funtool, MuPAD, and help
- Chapter exercises
- Appendix A. Syntax Quick Reference
- A.1 Expressions
- A.2 Function M-files
- A.3 Graphics
- A.4 if and switch
- A.5 For and while
- A.6 Input/output
- A.7 load/save
- A.8 Vectors and matrices
- Appendix B. Command and Function Quick Reference
- B.1 General purpose commands
- B.2 Logical functions
- B.3 Language constructs and debugging
- B.4 Matrices and matrix manipulation
- B.5 Mathematical functions
- B.6 Matrix functions
- B.7 Data analysis
- B.8 Polynomial functions
- B.9 Function functions
- B.10 Sparse matrix functions
- B.11 Character string functions
- B.12 File I/O functions
- B.13 Graphics
- Appendix C. ASCII Character Codes
- Appendix D. Solutions to Selected Exercises
- Chapter 1
- Chapter 2
- Chapter 3
- Chapter 4
- Chapter 5
- Chapter 6
- Chapter 7
- Chapter 8
- Chapter 9
- Chapter 11
- Chapter 13
- Chapter 14
- Index

## Key Features

- Updated with the features of MATLAB R2012b
- Expanded discussion of writing functions and scripts
- Revised and expanded Part II: Applications
- Expanded section on GUIs
- More exercises and examples throughout

## Readership

First time users of Matlab. Undergraduates in engineering and science courses that use Matlab. Any engineer or scientist needing an introduction to MATLAB.

## Table of Contents

- Preface
- Part I. Essentials
- Chapter 1. Introduction
- 1.1 Using MATLAB
- 1.2 The desktop
- 1.3 Sample program
- Chapter 2. MATLAB Fundamentals
- 2.1 Variables
- 2.2 The workspace
- 2.3 Arrays: Vectors and matrices
- 2.4 Vertical motion under gravity
- 2.5 Operators, expressions, and statements
- 2.6 Output
- 2.7 Repeating with for
- 2.8 Decisions
- 2.9 Complex numbers
- Summary
- Chapter exercises
- Chapter 3. Program Design and Algorithm Development
- 3.1 The program design process
- 3.2 Programming MATLAB functions
- Summary
- Chapter exercises
- Chapter 4. MATLAB Functions and Data Import-Export Utilities
- 4.1 Common functions
- 4.2 Importing and exporting data
- Summary
- Chapter exercises
- Chapter 5. Logical vectors
- 5.1 Examples
- 5.2 Logical operators
- 5.3 Subscripting with logical vectors
- 5.4 Logical functions
- 5.5 Logical vectors instead of elseif ladders
- Summary
- Chapter exercises
- Chapter 6. Matrices and Arrays
- 6.1 Matrices
- 6.2 Matrix operations
- 6.3 Other matrix functions
- 6.4 Population growth: Leslie matrices
- 6.5 Markov processes
- 6.6 Linear equations
- 6.7 Sparse matrices
- Summary
- Chapter exercises
- Chapter 7. Function M-files
- 7.1 Example: Newton’s method again
- 7.2 Basic rules
- 7.3 Function handles
- 7.4 Command/function duality
- 7.5 Function name resolution
- 7.6 Debugging M-files
- 7.7 Recursion
- Summary
- Chapter exercises
- Chapter 8. Loops
- 8.1 Determinate repetition with series for
- 8.2 Indeterminate repetition with series while
- Summary
- Chapter exercises
- Chapter 9. MATLAB Graphics
- 9.1 Basic 2-D graphs
- 9.2 3-D plots
- 9.3 Handle Graphics
- 9.4 Editing plots
- 9.5 Animation
- 9.6 Color etc.
- 9.7 Lighting and camera
- 9.8 Saving, printing and exporting graphs
- Summary
- Chapter exercises
- Chapter 10. Vectors as Arrays and Other Data Structures
- 10.1 Update processes
- 10.2 Frequencies, bar charts, and histograms
- 10.3 Sorting
- 10.4 Structures
- 10.5 Cell arrays
- 10.6 Classes and objects
- Summary
- Chapter 11. Errors and Pitfalls
- 11.1 Syntax errors
- 11.2 Logic errors
- 11.3 Rounding error
- Summary
- Chapter exercises
- Part II. Applications
- Chapter 12. Dynamical Systems
- 12.1 Cantilever beam
- 12.2 Electric current
- 12.3 Free fall
- 12.4 Projectile with friction
- Summary
- Chapter exercises
- Chapter 13. Simulation
- 13.1 Random number generation
- 13.2 Spinning coins
- 13.3 Rolling dice
- 13.4 Bacteria division
- 13.5 A random walk
- 13.6 Traffic flow
- 13.7 Normal (Gaussian) random numbers
- Summary
- Chapter exercises
- Chapter 14. Introduction to Numerical Methods
- 14.1 Equations
- 14.2 Integration
- 14.3 Numerical differentiation
- 14.4 First-order differential equations
- 14.5 Linear ordinary differential equations (LODEs)
- 14.6 Runge-Kutta methods
- 14.7 A partial differential equation
- 14.8 Other numerical methods
- Chapter 15. Signal Processing
- 15.1 Harmonic analysis
- 15.2 Fast Fourier Transform (FFT)
- Chapter 16. SIMULINK® Toolbox
- 16.1 Mass-spring-damper dynamic system
- 16.2 Bouncing ball dynamic system
- 16.3 The van der Pol oscillator
- 16.4 The Duffing oscillator
- Chapter exercises
- Chapter 17. Symbolics Toolbox
- 17.1 Algebra
- 17.2 Calculus
- 17.3 Laplace and Z transforms
- 17.4 Generalized Functions*
- 17.5 Differential equations
- 17.6 Implementation of funtool, MuPAD, and help
- Chapter exercises
- Appendix A. Syntax Quick Reference
- A.1 Expressions
- A.2 Function M-files
- A.3 Graphics
- A.4 if and switch
- A.5 For and while
- A.6 Input/output
- A.7 load/save
- A.8 Vectors and matrices
- Appendix B. Command and Function Quick Reference
- B.1 General purpose commands
- B.2 Logical functions
- B.3 Language constructs and debugging
- B.4 Matrices and matrix manipulation
- B.5 Mathematical functions
- B.6 Matrix functions
- B.7 Data analysis
- B.8 Polynomial functions
- B.9 Function functions
- B.10 Sparse matrix functions
- B.11 Character string functions
- B.12 File I/O functions
- B.13 Graphics
- Appendix C. ASCII Character Codes
- Appendix D. Solutions to Selected Exercises
- Chapter 1
- Chapter 2
- Chapter 3
- Chapter 4
- Chapter 5
- Chapter 6
- Chapter 7
- Chapter 8
- Chapter 9
- Chapter 11
- Chapter 13
- Chapter 14
- Index

## Details

- No. of pages:
- 424

- Language:
- English

- Copyright:
- © Academic Press 2013

- Published:
- 10th January 2013

- Imprint:
- Academic Press

- eBook ISBN:
- 9780123946133

- Paperback ISBN:
- 9780123943989

## About the Author

### Brian Hahn

### Affiliations and Expertise

Department of Mathematics and Applied Mathematics, University of Cape Town, South Africa

### Daniel Valentine

Daniel Valentine is a Professor of Mechanical and Aeronautical Engineering at Clarkson University and Affiliate Director of the Clarkson Space Grant Program which is part of the New York NASA Space Grant Consortium. This program has provided support for undergraduate research appointments, and for graduate students. He is currently investigating the nonlinear dynamics of two-dimensional, Navier-Stokes flows as part of his work on the development of computational methods to solve fluid dynamics problems. He is also working on the flow-structure interaction of long-span bridges, unsteady hydrodynamics and offshore renewable energy. Other activities include investigations to develop a computational method to predict the effect of a marine propulsor on wave resistance of ships, to examine the effect of density stratification on rotating flows, to develop computational tools to predict the time-averaged properties of high-Reynolds number flows among other fluid mechanics problems.

### Affiliations and Expertise

Dept of Mechanical and Aeronautical Engineering, Clarkson University, Potsdam, NY, USA