O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

MATLAB® by Example

Book Description

MATLAB By Example guides the reader through each step of writing MATLAB programs. The book assumes no previous programming experience on the part of the reader, and uses multiple examples in clear language to introduce concepts and practical tools. Straightforward and detailed instructions allow beginners to learn and develop their MATLAB skills quickly.

The book consists of ten chapters, discussing in detail the integrated development environment (IDE), scalars, vectors, arrays, adopting structured programming style using functions and recursive functions, control flow, debugging, profiling, and structures. A chapter also describes Symbolic Math Toolbox, teaching readers how to solve algebraic equations, differentiation, integration, differential equations, and Laplace and Fourier transforms. Containing hundreds of examples illustrated using screen shots, hundreds of exercises, and three projects, this book can be used to complement coursework or as a self-study book, and can be used as a textbook in universities, colleges and high schools.

  • No programming experience necessary to learn MATLAB
  • Examples with screenshots and plentiful exercises throughout help make MATLAB easy to understand
  • Projects enable readers to write long MATLAB programs, and take the first step toward being a professional MATLAB programmer

Table of Contents

  1. Cover image
  2. Title page
  3. Table of Contents
  4. Copyright
  5. Preface
  6. Acknowledgments
  7. Why This Book Is Different
  8. How This Book Is Organized
  9. 1. Matlab Integrated Development Environment
    1. Lesson 1.1 Basics of the Matlab Integrated Development Environment
    2. Lesson 1.2 Matlab Script Files
    3. Lesson 1.3 Matlab Editor—Cell Mode
    4. Answers to Selected Exercises
  10. 2. Scalars in Matlab
    1. Lesson 2.1 Creating and Naming Matlab Scalar Variables
    2. Lesson 2.2 Approximation of Numbers and Discrete Mathematical Operations
    3. Lesson 2.3 Mathematical Expressions for Scalar Variables
    4. Lesson 2.4 Relational and Logical Operations for Scalar Variables
    5. Lesson 2.5 Complex Scalar Variables
    6. Answers to Selected Exercises
  11. 3. Vectors in Matlab
    1. Lesson 3.1 Creating Vectors
    2. Lesson 3.2 Relational and Logical Operations on Vectors
    3. Lesson 3.3 Accessing Elements in Vectors
    4. Lesson 3.4 Arithmetical Operations on Vectors
    5. Lesson 3.5 Plotting Vectors
    6. Answers to Selected Exercises
  12. 4. Arrays in Matlab
    1. Lesson 4.1 Creating Arrays
    2. Lesson 4.2 Relational and Logical Operations on Arrays
    3. Lesson 4.3 Accessing Elements in Arrays
    4. Lesson 4.4 Arithmetical Operations on Arrays
    5. Lesson 4.5 Plotting Arrays
    6. Answers to Selected Exercises
  13. 5. Matlab Functions
    1. Lesson 5.1 Introduction to Functions
    2. Lesson 5.2 Creating Functions
    3. Lesson 5.3 Scope of Matlab Variables in a Function
    4. Answers to Selected Exercises
    5. Lesson 5.3
  14. 6. Conditional Statements in Matlab
    1. Lesson 6.1 The Construction of an if Statement
    2. Lesson 6.2 The Construction of an if else Statement
    3. Lesson 6.3 Recursive Functions
    4. Lesson 6.4 The Construction of an if elseif else Statement
    5. Lesson 6.5 The Construction of a switch case Statement
    6. Answers to Selected Exercises
  15. 7. Loop Statements in Matlab
    1. Lesson 7.1 The Construction of a for Loop Statement
    2. Lesson 7.2 The Construction of Combined for and if Statements
    3. Lesson 7.3 The Construction of a while Loop Statement
    4. Answers to Selected Exercises
    5. Projects
  16. 8. Matlab Debugging, Profiling, and Code Indentation
    1. Lesson 8.1 Matlab Debugging
    2. Lesson 8.2 Debugging Matlab Functions
    3. Lesson 8.3 Advanced Matlab Debugging Tools
    4. Lesson 8.4 The Matlab Profiler Tool
    5. Lesson 8.5 Matlab Code Indentation
    6. Answers to Selected Exercises
  17. 9. Structures in Matlab
    1. Lesson 9.1 Structures in Matlab
    2. Lesson 9.2 A Vector of Structures
    3. Answers to Selected Exercises
    4. Project: The Fox and Rabbit Game
  18. 10. Calculus in Matlab
    1. Lesson 10.1 Introduction to Symbolic Math Toolbox
    2. Lesson 10.2 Algebraic Equations
    3. Lesson 10.3 Differentiation and Integration
    4. Lesson 10.4 Differential Equations
    5. Lesson 10.5 Laplace and Fourier Transforms
    6. Answers to Selected Exercises