Table of Contents. Introduction.*.. 7. Part /: Getting Started With MATLAB 5. Chapter 1: Introducing MATLAB and Its Many Uses 7

Similar documents
MATLAB.

LEARNING TO PROGRAM WITH MATLAB. Building GUI Tools. Wiley. University of Notre Dame. Craig S. Lent Department of Electrical Engineering

INTRODUCTION TO MATLAB, SIMULINK, AND THE COMMUNICATION TOOLBOX

STEPHEN WOLFRAM MATHEMATICADO. Fourth Edition WOLFRAM MEDIA CAMBRIDGE UNIVERSITY PRESS

Introduction to Matlab

Huei-Huang Lee. Programming with MATLAB2016 SDC ACCESS CODE. Better Textbooks. Lower Prices. UNIQUE CODE INSIDE

PROGRAMMING AND ENGINEERING COMPUTING WITH MATLAB Huei-Huang Lee SDC. Better Textbooks. Lower Prices.

Appendix A. Introduction to MATLAB. A.1 What Is MATLAB?

UNIVERSITI TEKNIKAL MALAYSIA MELAKA FAKULTI KEJURUTERAAN ELEKTRONIK DAN KEJURUTERAAN KOMPUTER

PTC Mathcad Prime 3.0

Introduction to MATLAB

Introduction to MATLAB

University of Engineering and Technology, Taxila Department of Civil Engineering

For more info and downloads go to: Gerrit Stols

A Guide to Using Some Basic MATLAB Functions

ECON 502 INTRODUCTION TO MATLAB Nov 9, 2007 TA: Murat Koyuncu

MatLab Just a beginning

Models for Nurses: Quadratic Model ( ) Linear Model Dx ( ) x Models for Doctors:

Maths for Signals and Systems Linear Algebra in Engineering. Some problems by Gilbert Strang

Introduction to MATLAB

Contents. Implementing the QR factorization The algebraic eigenvalue problem. Applied Linear Algebra in Geoscience Using MATLAB

CS184: Using Quaternions to Represent Rotation

2.0 MATLAB Fundamentals

Quickstart for Web and Tablet App

Why use MATLAB? Mathematcal computations. Used a lot for problem solving. Statistical Analysis (e.g., mean, min) Visualisation (1D-3D)

MATLAB Project: Getting Started with MATLAB

Essential MATLAB for Engineers and Scientists

ECE 202 LAB 3 ADVANCED MATLAB

MATLAB Programming for Numerical Computation Dr. Niket Kaisare Department Of Chemical Engineering Indian Institute of Technology, Madras

MATLAB 7 Getting Started Guide

Introduction to MatLab. Introduction to MatLab K. Craig 1

MATLAB 7. The Language of Technical Computing KEY FEATURES

Matlab Tutorial 1: Working with variables, arrays, and plotting

UNIVERSITI TEKNIKAL MALAYSIA MELAKA FAKULTI KEJURUTERAAN ELEKTRONIK DAN KEJURUTERAAN KOMPUTER

Introduction to Scientific Computing with Matlab

Nuts & Bolts guide to MATLAB

Pre-Lab Excel Problem

Quickstart for Desktop Version

3D plot of a surface in Matlab

MATLAB Tutorial. Primary Author: Shoumik Chatterjee Secondary Author: Dr. Chuan Li

Introduction to Matlab. By: Hossein Hamooni Fall 2014

Matlab Programming MET 164 1/24

CE890 / ENE801 Lecture 1 Introduction to MATLAB

(Creating Arrays & Matrices) Applied Linear Algebra in Geoscience Using MATLAB

Integrated Math I. IM1.1.3 Understand and use the distributive, associative, and commutative properties.

Session 3 Introduction to SIMULINK

PC-MATLAB PRIMER. This is intended as a guided tour through PCMATLAB. Type as you go and watch what happens.

Creates a 1 X 1 matrix (scalar) with a value of 1 in the column 1, row 1 position and prints the matrix aaa in the command window.

Introduction to Matlab. Summer School CEA-EDF-INRIA 2011 of Numerical Analysis

Technology Assignment: Scatter Plots

INTRODUCTION TO MATLAB

Dynamics and Vibrations Mupad tutorial

EE3TP4: Signals and Systems Lab 1: Introduction to Matlab Tim Davidson Ext Objective. Report. Introduction to Matlab

Maple Quick Start. Maplesoft, a division of Waterloo Maple Inc.

Using MATLAB, SIMULINK and Control System Toolbox

EXERCISES Introduction to MATLAB: Graphics

Excel Primer CH141 Fall, 2017

An Introduction to Numerical Methods

PhysicsAndMathsTutor.com

Polymath 6. Overview

Introduction to MATLAB

YOGYAKARTA STATE UNIVERSITY MATHEMATICS AND NATURAL SCIENCES FACULTY MATHEMATICS EDUCATION STUDY PROGRAM

Getting Started with MATLAB

Introduction to Matlab

Lab of COMP 406. MATLAB: Quick Start. Lab tutor : Gene Yu Zhao Mailbox: or Lab 1: 11th Sep, 2013

Matlab Primer. Lecture 02a Optical Sciences 330 Physical Optics II William J. Dallas January 12, 2005

Experiment 1: Introduction to MATLAB I. Introduction. 1.1 Objectives and Expectations: 1.2 What is MATLAB?

Chapter 2. MathScript

Matrices. Chapter Matrix A Mathematical Definition Matrix Dimensions and Notation

Getting Started with MATLAB

Introduction to MATLAB

Appendix A. HINTS WHEN USING EXCEL w

Introduction to Matlab. By: Dr. Maher O. EL-Ghossain

Introduction to Simulink

Chapter 1 Introduction to MATLAB

PowerPoints organized by Dr. Michael R. Gustafson II, Duke University

VBScript: Math Functions

Page 1 of 7 E7 Spring 2009 Midterm I SID: UNIVERSITY OF CALIFORNIA, BERKELEY Department of Civil and Environmental Engineering. Practice Midterm 01

MATLAB Modul 3. Introduction

Getting Started With Excel

Contents Computing with Formulas

8.1 R Computational Toolbox Tutorial 3

PITSCO Math Individualized Prescriptive Lessons (IPLs)

Variable Definition and Statement Suppression You can create your own variables, and assign them values using = >> a = a = 3.

Introduction to MATLAB LAB 1

ELEMENTARY MATH GRADE 5. The Level 2 student is approaching proficient in

Middle School Math Course 3

MATLAB Basics EE107: COMMUNICATION SYSTEMS HUSSAIN ELKOTBY

Getting Started with DADiSP

Introduction to Matlab

MATLAB Project: Getting Started with MATLAB

CITS2401 Computer Analysis & Visualisation

MATLAB Basics. Configure a MATLAB Package 6/7/2017. Stanley Liang, PhD York University. Get a MATLAB Student License on Matworks

Getting started with MATLAB

Introduction to MATLAB

Carnegie LearningĂ’ Middle School Math Solution Correlations Course 3 NCSCoS: Grade 8

Introduction to Octave/Matlab. Deployment of Telecommunication Infrastructures

EE 216 Experiment 1. MATLAB Structure and Use

Revision Topic 11: Straight Line Graphs

Chapter 2. MATLAB Fundamentals

Transcription:

MATLAB

Table of Contents Introduction.*.. 7 About This Book 1 Foolish Assumptions 2 Icons Used in This Book 3 Beyond the Book 3 Where to Go from Here 4 Part /: Getting Started With MATLAB 5 Chapter 1: Introducing MATLAB and Its Many Uses 7 Putting MATLAB in Its Place 8 Understanding how MATLAB relates to a Turing machine 8 Using MATLAB as more than a calculator 10 Determining why you need MATLAB 11 Discovering Who Uses MATLAB for Real-World Tasks 13 Knowing How to Get the Most from MATLAB 14 Getting the basic computer skills 15 Defining the math requirements 15 Applying what you know about other procedural languages 16 Understanding how this book will help you 16 Getting Over the Learning Curve 17 Chapter 2: Starting Your Copy of MATLAB 19 Installing MATLAB 19 Discovering which platforms MATLAB supports 19 Getting your copy of MATLAB 20 Performing the installation 21 Activating the product 21 Meeting the MATLAB Interface 22 Starting MATLAB for the first time 22 Employing the Command window 24 Using the Current Folder toolbar 27 Viewing the Current Folder window 28 Changing the MATLAB layout 33

MATLAB For Dummies Chapter 3: Interacting with MATLAB 37 Using MATLAB as a Calculator 38 Entering information at the prompt 38 Entering a formula 40 Copying and pasting formulas 41 Changing the Command window formatting 42 Suppressing Command window output 44 Understanding the MATLAB Math Syntax 44 Adding, subtracting, multiplying, and dividing 45 Working with exponents 47 Organizing Your Storage Locker 48 Using ans the default storage locker 48 Creating your own storage lockers 48 Operating MATLAB as More Than a Calculator 50 Learning the truth 50 Using the built-in functions 52 Accessing the function browser 52 Recovering from Mistakes 54 Understanding the MATLAB error messages 54 Stopping MATLAB when it hangs 55 Getting Help 55 Exploring the documentation 56 Working through the examples 56 Relying on peer support 57 Obtaining training 57 Requesting support from MathWorks 58 Contacting the authors 58 Chapter 4: Starting, Storing, and Saving MATLAB Files 59 Examining MATLAB's File Structure 60 Understanding the MATLAB files and what they do 60 Exploring folders with the GUI 61 Exploring folders with commands 65 Working with files in MATLAB 69 Accessing and Sharing MATLAB Files 72 Opening 72 Importing 73 Exporting 75 Saving Your Work 76 Saving variables with the GUI 76 Saving variables using commands 77 Saving commands with the GUI 77 Saving commands using commands 77

Table of Contents Part //; Manipulating and Plotting Data in MATLAB 79 Chapter 5: Embracing Vectors, Matrices, and Higher Dimensions... 81 Working with Vectors and Matrices 81 Understanding MATLAB's perspective of linear algebra 82 Entering data 83 Adding and Subtracting 88 Understanding the Many Ways to Multiply and Divide 89 Performing scalar multiplication and division 90 Employing matrix multiplication 90 Effecting matrix division 94 Creating powers of matrices 95 Working element by element 96 Using complex numbers 97 Working with exponents 99 Working with Higher Dimensions 99 Creating a multidimensional matrix 100 Accessing a multidimensional matrix 102 Replacing individual elements 103 Replacing a range of elements 104 Modifying the matrix size 105 Using cell arrays and structures 107 Using the Matrix Helps 110 Chapter 6: Understanding Plotting Basics 115 Considering Plots 115 Understanding what you can do with plots 116 Comparing MATLAB plots to spreadsheet graphs 116 Creating a plot using commands 117 Creating a plot using the Workspace window 119 Creating a plot using the Plots tab options 120 Using the Plot Function 122 Working with line color, markers, and line style 122 Creating multiple plots in a single command 124 Modifying Any Plot 124 Making simple changes 125 Adding to a plot 125 Deleting a plot 128 Working with subplots 128 Plotting with 2D Information 132

MATLAB For Dummies Chapter 7: Using Advanced Plotting Features 135 Plotting with 3D Information 136 Using the bar() function to obtain a flat 3D plot 136 Using bar3() to obtain a dimensional 3D plot 140 Using barh() and more 142 Enhancing Your Plots 143 Getting an axes handle 143 Modifying axes labels 144 Adding a title 145 Rotating label text 147 Employing annotations 148 Printing your plot 150 Part Ilk Streamtimnq MATLAB 151 Chapter 8: Automating Your Work 153 Understanding What Scripts Do 154 Creating less work for yourself 154 Defining when to use a script 155 Creating a Script 155 Writing your first script 156 Using commands for user input 158 Copying and pasting into a script 159 Converting the Command History into a script 160 Continuing long strings 160 Adding comments to your script 162 Revising Scripts 167 Calling Scripts 167 Improving Script Performance 168 Analyzing Scripts for Errors 169 Chapter 9: Expanding MATLAB's Power with Functions 171 Working with Built-in Functions 172 Learning about built-in functions 172 Sending data in and getting data out 177 Creating a Function 178 Understanding script and function differences 179 Understanding built-in function and custom function differences 179 Writing your first function 180 Using the new function 182 Passing data in 184 Passing data out 185

Table of Contents #1 Creating and using global variables 187 Using subfunctions 188 Nesting functions 190 Using Other Types of Functions 190 Inline functions 191 Anonymous functions 191 Chapter 10: Adding Structure to Your Scripts 193 Making Decisions 193 Using the if statement 194 Using the switch statement 199 Understanding the switch difference 200 Deciding between if and switch 201 Creating Recursive Functions 201 Performing Tasks Repetitively 205 Using the for statement 205 Using the while statement 206 Ending processing using break 207 Ending processing using return 208 Determining which loop to use 210 Creating Menus 210 Part W: Employing Advanced MAILAB Techniques 213 Chapter 11: Importing and Exporting Data 215 Importing Data 216 Performing import basics 216 Importing mixed strings and numbers 221 Defining the delimiter types 223 Importing selected rows or columns 224 Exporting Data 225 Performing export basics 225 Exporting scripts and functions 228 Working with Images 229 Exporting images 230 Importing images 231 Chapter 12: Printing and Publishing Your Work 233 Using Commands to Format Text 233 Modifying font appearance 234 Using special characters 241 Adding math symbols 243

MATLAB For Dummies Publishing Your MATLAB Data 248 Performing advanced script and function publishing tasks 248 Saving your figures to disk 252 Printing Your Work 253 Configuring the output page 253 Printing the data 255 Chapter 13: Recovering from Mistakes 257 Working with Error Messages 258 Responding to error messages 258 Understanding the MException class 260 Creating error and warning messages 262 Setting warning message modes 264 Understanding Quick Alerts 265 Relying on Common Fixes for MATLAB's Error Messages 267 Making Your Own Error Messages 268 Developing the custom error message 268 Creating useful error messages 272 Using Good Coding Practices 273 Part V: Specific MATLAB Applications 277 Chapter 14: Solving Equations and Finding Roots 279 Working with the Symbolic Math Toolbox 279 Obtaining your copy of the Toolbox 280 Installing the Symbolic Math Toolbox 282 Working with the GUI 286 Typing a simple command in the Command window 290 Performing Algebraic Tasks 291 Differentiating between numeric and symbolic algebra 291 Solving quadratic equations 293 Working with cubic and other nonlinear equations 294 Understanding interpolation 295 Working with Statistics 297 Understanding descriptive statistics 297 Understanding robust statistics 302 Employing least squares fit 302 Chapter 15: Performing Analysis 307 Using Linear Algebra 308 Working with determinants 308 Performing reduction 308 Using eigenvalues 310 Understanding factorization 311

Table of Contents «««Kill Employing Calculus 312 Working with differential calculus 312 Using integral calculus 313 Working with multivariate calculus 314 Solving Differential Equations 316 Using the numerical approach 316 Using the symbolic approach 317 Chapter 16: Creating Super Plots 319 Understanding What Defines a Super Plot 320 Using the Plot Extras 321 Using grid() 321 Obtaining the current axis using gca 322 Creating axis dates using datetick( ) 322 Creating plots with colorbar( ) 326 Interacting with daspect 329 Interacting with pbaspect 332 Working with Plot Routines 334 Finding data deviations using errorbar( ) 334 Ranking related measures using pareto( ) 334 Plotting digital data using stairs() 335 Showing data distribution using stem( ) 336 Drawing images using fill 337 Displaying velocity vectors using quiver() 340 Displaying velocity vectors using feather( ) 340 Displaying velocity vectors using compass( ) 340 Working with polar coordinates using polar() 342 Displaying angle distribution using rose( ) 342 Spotting sparcity patterns using spy( ) 344 Employing Animation 344 Working with movies 346 Working with objects 347 Performing data updates 348 Part VI: The Part of Tens 351 Chapter 17: Top Ten Uses of MATLAB 353 Engineering New Solutions 353 Getting an Education 354 Working with Linear Algebra 355 Performing Numerical Analysis 355 Getting Involved in Science 356 Engaging Mathematics 356 Exploring Research 356

MATLAB For Dummies Walking through a Simulation 357 Employing Image Processing 358 Embracing Programming Using Computer Science 358 Chapter 18: Ten Ways to Make a Living Using MATLAB 361 Working with Green Technology 362 Looking for Unexploded Ordinance 362 Creating Speech Recognition Software 363 Getting Disease under Control 363 Becoming a Computer Chip Designer 364 Keeping the Trucks Rolling 364 Creating the Next Generation of Products 364 Designing Equipment Used in the Field 365 Performing Family Planning 365 Reducing Risks Using Simulation 366 Appendix A: MATLAB Functions 367 Appendix B: MATLAB's Plotting Routines 377 index - 385