An Introduction to Technical Problem Solving with MATLAB v.7
Second Edition
Jon Sticklen and M. Taner Eskil
Table of Contents
Acknowledgements
Preface (Primarily for Instructors)
Preface to the Second Edition
Chapter 1: Introduction to Technical Problem Solving and MATLAB
What is Technical Problem Solving?
The Path to Becoming a Good Technical Problem Solver
Your Part of the Bargain
Chapter 2: A Framework for Technical Problem Solving
Steps in a Framework for Technical Problem Solving
An Example Using the Framework
Refining and Structuring the Problem
A Sketch or Diagram of the Example Problem
Background Knowledge for the Example Problem
The Assumptions and Approximations of the Example Problem
Decomposing the Problem/Recursive Structuring of the Example Problem
Dimensional Analysis for the
Example Problem
Putting It All Together: The Solution for the Example Problem and Discussion of Results
Problem Set for this Chapter
Chapter 3: MATLAB Basics: Scalars
The First Time You Open MATLAB
MATLAB as a Calculator for Scalars
Fetching and Setting Scalar Variables
A Mental Model for Computer Variables
Setting Variables for the Hay Bale Problem (from Section 2-2)
MATLAB Built-in Functions, Operators, and Expressions
Built-In Functions
Expressions and Rules for Forming Expressions
Synopsis of Scalar Built-In Functions, Operators, and Expressions
Problem Sets for Scalars
Set A: Nuts and Bolts Problems for Scalars
Set B: Problem Solving with MATLAB Scalars
Chapter 4: Saving Your Work
in MATLAB
The MATLAB Current Directory
Saving MATLAB Commands in Script Files
Saving MATLAB Commands in User-Defined Function Files
Testing and Debugging MATLAB Script and Function Files
Syntax Errors
Runtime Errors
Problem Sets for Saving Your Work
Set A: Nuts and Bolts Problems for Saving Your Work
Set B: Problem-Solving Using MATLAB User-Defined Functions
Chapter 5: Vector Operations
Vector Creation
Accessing Vector Elements
Fetching Elements of Vectors
Setting Elements of Vectors
Row Vectors and Column Vectors, and the Transpose Operator
Vector Built-In Functions, Operators, and Expressions
Vector Built-In Functions
Vector Operators
Vector Expressions and Rules
for Forming Vector Expressions
Section Synopsis
Problem Sets for Vectors
Set A: Nuts and Bolts Problems for Vectors
Set B: Problem Solving with MATLAB Vectors
Chapter 6: 2-D and 3-D Plotting and Using MATLAB Help
Using ezplot to Graph Functions
Using ezplot for a Function of One Variable and Getting Help
Using ezplot for a Function of Two Variables (Implicit form)
Using ezplot for Two Functions of the Same Variable (Parametereized form)
Synopsis
Using plot to Graph Numerical Data
Plotting Actual Numerical Data of Two Variables
Plotting Functions Using a Numerical Approach
Overlay Plots and Subplots
Overlay Plots
Subplots
Section Synopsis
3-D Plotting with MATLAB
Creating
3-D Functional Plots (ezplot3 and ezsurf)
Creating Data Plots for Datasets of Three Variables
Using meshgrid, griddata, and mesh
Creating Functional Plots for Functions of Two Variables
Using meshgrid and surf
Section Synopsis
Other Plot Types and Other Tools
Problem Sets for 2-D and 3-D Plotting
Set A: Nuts and Bolts Problems for 2-D and 3-D Plotting
Set B: Problem Solving with MATLAB 2-D Plotting
Chapter 7: Arrays
Array Creation
Accessing Array Elements
Fetching Elements of Arrays
Setting Elements of Arrays
Use of end for Array Access and the size Built-In Function
Transpose Applied to Arrays
Array Built-In Functions, Operators, and Expressions
Array Built-In Functions
Array Operators
Array Expressions and Rules for Forming Array Expressions
Section Synopsis
Problem Sets for Arrays
Set A: Nuts and Bolts Problems for Arrays
Set B: Problem Solving with MATLAB Arrays
Chapter 8: More Flexibility: Introduction to Conditional and Iterative Programming
A Focus Problem
General Picture, Program Flow
Iterative Program Flow: For LOOP
General Form of a FOR Loop in MATLAB
Iteration Over Elements of a Row Vector Using FOR
Iteration Over Columns of an Array Using FOR
Nested FOR Loops in MATLAB
Solving the Big League Bats Problem: Version 1
Synopsis of MATLAB FOR Loop
Conditional Program Flow: IF-THEN-ELSE
General Forms of IF-THEN-ELSE
IF-THEN-ELSE Form
1: IF
IF-THEN-ELSE Form 2: IF/ELSE
IF-THEN-ELSE Form 3: IF/ELSEIF
IF-THEN-ELSE Form 4: IF/ELSEIF/ELSE
Solving the Big League Bats Problem: Version 2
Synopsis of MATLAP IF-THEN-ELSE Conditional
Iterative Program Flow: While LOOP
General Form of a WHILE Loop in MATLAB
Example of a WHILE Loop
Synopsis of MATLAB WHILE Loop
Problem Sets for IF-THEN-ELSE, For LOOP, and WHILE LOOP
Set A: Nuts and Bolts Problems for Programming Constructs
Set B: Problem Solving Using Programming Constructs