You are previewing MATLAB For Dummies.
O'Reilly logo
MATLAB For Dummies

Book Description

Plot graphs, solve equations, and write code in a flash!

If you work in a STEM field, chances are you'll be using MATLAB on a daily basis. MATLAB is a popular and powerful computational tool and this book provides everything you need to start manipulating and plotting your data. MATLAB has rapidly become the premier data tool, and MATLAB For Dummies is a comprehensive guide to the fundamentals. MATLAB For Dummies guides you through this complex computational language from installation to visualization to automation.

  • Learn MATLAB's language fundamentals including syntax, operators, and data types

  • Understand how to use the most important window in MATLAB - the Command Window

  • Get the basics of linear algebra to get up and running with vectors, matrices, and hyperspace

  • Automate your work with programming scripts and functions

  • Plot graphs in 2D and 3D to visualize your data

  • Includes a handy guide for MATLAB's functions and plotting routines

  • MATLAB is an essential part of the analysis arsenal and MATLAB For Dummies provides clear, thorough guidance to get the most out of your data.

    Table of Contents

      1. Introduction
        1. About This Book
        2. Foolish Assumptions
        3. Icons Used in This Book
        4. Beyond the Book
        5. Where to Go from Here
      2. Part I: Getting Started With MATLAB
        1. Chapter 1: Introducing MATLAB and Its Many Uses
          1. Putting MATLAB in Its Place
            1. Understanding how MATLAB relates to a Turing machine
            2. Using MATLAB as more than a calculator
            3. Determining why you need MATLAB
          2. Discovering Who Uses MATLAB for Real-World Tasks
          3. Knowing How to Get the Most from MATLAB
            1. Getting the basic computer skills
            2. Defining the math requirements
            3. Applying what you know about other procedural languages
            4. Understanding how this book will help you
          4. Getting Over the Learning Curve
        2. Chapter 2: Starting Your Copy of MATLAB
          1. Installing MATLAB
            1. Discovering which platforms MATLAB supports
            2. Getting your copy of MATLAB
            3. Performing the installation
            4. Activating the product
          2. Meeting the MATLAB Interface
            1. Starting MATLAB for the first time
            2. Employing the Command window
            3. Using the Current Folder toolbar
            4. Viewing the Current Folder window
            5. Changing the MATLAB layout
        3. Chapter 3: Interacting with MATLAB
          1. Using MATLAB as a Calculator
            1. Entering information at the prompt
            2. Entering a formula
            3. Copying and pasting formulas
            4. Changing the Command window formatting
            5. Suppressing Command window output
          2. Understanding the MATLAB Math Syntax
            1. Adding, subtracting, multiplying, and dividing
            2. Working with exponents
          3. Organizing Your Storage Locker
            1. Using ans — the default storage locker
            2. Creating your own storage lockers
          4. Operating MATLAB as More Than a Calculator
            1. Learning the truth
            2. Using the built-in functions
            3. Accessing the function browser
          5. Recovering from Mistakes
            1. Understanding the MATLAB error messages
            2. Stopping MATLAB when it hangs
          6. Getting Help
            1. Exploring the documentation
            2. Working through the examples
            3. Relying on peer support
            4. Obtaining training
            5. Requesting support from MathWorks
            6. Contacting the authors
        4. Chapter 4: Starting, Storing, and Saving MATLAB Files
          1. Examining MATLAB’s File Structure
            1. Understanding the MATLAB files and what they do
            2. Exploring folders with the GUI
            3. Exploring folders with commands
            4. Working with files in MATLAB
          2. Accessing and Sharing MATLAB Files
            1. Opening
            2. Importing
            3. Exporting
          3. Saving Your Work
            1. Saving variables with the GUI
            2. Saving variables using commands
            3. Saving commands with the GUI
            4. Saving commands using commands
      3. Part II: Manipulating and Plotting Data in MATLAB
        1. Chapter 5: Embracing Vectors, Matrices, and Higher Dimensions
          1. Working with Vectors and Matrices
            1. Understanding MATLAB’s perspective of linear algebra
            2. Entering data
          2. Adding and Subtracting
          3. Understanding the Many Ways to Multiply and Divide
            1. Performing scalar multiplication and division
            2. Employing matrix multiplication
            3. Effecting matrix division
            4. Creating powers of matrices
            5. Working element by element
            6. Using complex numbers
            7. Working with exponents
          4. Working with Higher Dimensions
            1. Creating a multidimensional matrix
            2. Accessing a multidimensional matrix
            3. Replacing individual elements
            4. Replacing a range of elements
            5. Modifying the matrix size
            6. Using cell arrays and structures
          5. Using the Matrix Helps
        2. Chapter 6: Understanding Plotting Basics
          1. Considering Plots
            1. Understanding what you can do with plots
            2. Comparing MATLAB plots to spreadsheet graphs
            3. Creating a plot using commands
            4. Creating a plot using the Workspace window
            5. Creating a plot using the Plots tab options
          2. Using the Plot Function
            1. Working with line color, markers, and line style
            2. Creating multiple plots in a single command
          3. Modifying Any Plot
            1. Making simple changes
            2. Adding to a plot
            3. Deleting a plot
            4. Working with subplots
          4. Plotting with 2D Information
        3. Chapter 7: Using Advanced Plotting Features
          1. Plotting with 3D Information
            1. Using the bar() function to obtain a flat 3D plot
            2. Using bar3() to obtain a dimensional 3D plot
            3. Using barh() and more
          2. Enhancing Your Plots
            1. Getting an axes handle
            2. Modifying axes labels
            3. Adding a title
            4. Rotating label text
            5. Employing annotations
            6. Printing your plot
      4. Part III: Streamlining MATLAB
        1. Chapter 8: Automating Your Work
          1. Understanding What Scripts Do
            1. Creating less work for yourself
            2. Defining when to use a script
          2. Creating a Script
            1. Writing your first script
            2. Using commands for user input
            3. Copying and pasting into a script
            4. Converting the Command History into a script
            5. Continuing long strings
            6. Adding comments to your script
          3. Revising Scripts
          4. Calling Scripts
          5. Improving Script Performance
          6. Analyzing Scripts for Errors
        2. Chapter 9: Expanding MATLAB’s Power with Functions
          1. Working with Built-in Functions
            1. Learning about built-in functions
            2. Sending data in and getting data out
          2. Creating a Function
            1. Understanding script and function differences
            2. Understanding built-in function and custom function differences
            3. Writing your first function
            4. Using the new function
            5. Passing data in
            6. Passing data out
            7. Creating and using global variables
            8. Using subfunctions
            9. Nesting functions
          3. Using Other Types of Functions
            1. Inline functions
            2. Anonymous functions
        3. Chapter 10: Adding Structure to Your Scripts
          1. Making Decisions
            1. Using the if statement
            2. Using the switch statement
            3. Understanding the switch difference
            4. Deciding between if and switch
          2. Creating Recursive Functions
          3. Performing Tasks Repetitively
            1. Using the for statement
            2. Using the while statement
            3. Ending processing using break
            4. Ending processing using return
            5. Determining which loop to use
          4. Creating Menus
      5. Part IV: Employing Advanced MATLAB Techniques
        1. Chapter 11: Importing and Exporting Data
          1. Importing Data
            1. Performing import basics
            2. Importing mixed strings and numbers
            3. Defining the delimiter types
            4. Importing selected rows or columns
          2. Exporting Data
            1. Performing export basics
            2. Exporting scripts and functions
          3. Working with Images
            1. Exporting images
            2. Importing images
        2. Chapter 12: Printing and Publishing Your Work
          1. Using Commands to Format Text
            1. Modifying font appearance
            2. Using special characters
            3. Adding math symbols
          2. Publishing Your MATLAB Data
            1. Performing advanced script and function publishing tasks
            2. Saving your figures to disk
          3. Printing Your Work
            1. Configuring the output page
            2. Printing the data
        3. Chapter 13: Recovering from Mistakes
          1. Working with Error Messages
            1. Responding to error messages
            2. Understanding the MException class
            3. Creating error and warning messages
            4. Setting warning message modes
          2. Understanding Quick Alerts
          3. Relying on Common Fixes for MATLAB’s Error Messages
          4. Making Your Own Error Messages
            1. Developing the custom error message
            2. Creating useful error messages
          5. Using Good Coding Practices
      6. Part V: Specific MATLAB Applications
        1. Chapter 14: Solving Equations and Finding Roots
          1. Working with the Symbolic Math Toolbox
            1. Obtaining your copy of the Toolbox
            2. Installing the Symbolic Math Toolbox
            3. Working with the GUI
            4. Typing a simple command in the Command window
          2. Performing Algebraic Tasks
            1. Differentiating between numeric and symbolic algebra
            2. Solving quadratic equations
            3. Working with cubic and other nonlinear equations
            4. Understanding interpolation
          3. Working with Statistics
          4. Understanding descriptive statistics
          5. Understanding robust statistics
          6. Employing least squares fit
        2. Chapter 15: Performing Analysis
          1. Using Linear Algebra
            1. Working with determinants
            2. Performing reduction
            3. Using eigenvalues
            4. Understanding factorization
          2. Employing Calculus
            1. Working with differential calculus
            2. Using integral calculus
            3. Working with multivariate calculus
          3. Solving Differential Equations
            1. Using the numerical approach
            2. Using the symbolic approach
        3. Chapter 16: Creating Super Plots
          1. Understanding What Defines a Super Plot
          2. Using the Plot Extras
            1. Using grid()
            2. Obtaining the current axis using gca
            3. Creating axis dates using datetick()
            4. Creating plots with colorbar()
            5. Interacting with daspect
            6. Interacting with pbaspect
          3. Working with Plot Routines
            1. Finding data deviations using errorbar()
            2. Ranking related measures using pareto()
            3. Plotting digital data using stairs()
            4. Showing data distribution using stem()
            5. Drawing images using fill
            6. Displaying velocity vectors using quiver()
            7. Displaying velocity vectors using feather()
            8. Displaying velocity vectors using compass()
            9. Working with polar coordinates using polar()
            10. Displaying angle distribution using rose()
            11. Spotting sparcity patterns using spy()
          4. Employing Animation
          5. Working with movies
          6. Working with objects
          7. Performing data updates
      7. Part VI: The Part of Tens
        1. Chapter 17: Top Ten Uses of MATLAB
          1. Engineering New Solutions
          2. Getting an Education
          3. Working with Linear Algebra
          4. Performing Numerical Analysis
          5. Getting Involved in Science
          6. Engaging Mathematics
          7. Exploring Research
          8. Walking through a Simulation
          9. Employing Image Processing
          10. Embracing Programming Using Computer Science
        2. Chapter 18: Ten Ways to Make a Living Using MATLAB
          1. Working with Green Technology
          2. Looking for Unexploded Ordinance
          3. Creating Speech Recognition Software
          4. Getting Disease under Control
          5. Becoming a Computer Chip Designer
          6. Keeping the Trucks Rolling
          7. Creating the Next Generation of Products
          8. Designing Equipment Used in the Field
          9. Performing Family Planning
          10. Reducing Risks Using Simulation
        3. Appendix A: MATLAB Functions
        4. Appendix B: MATLAB’s Plotting Routines
      8. About the Authors
      9. Cheat Sheet
      10. More Dummies Products