- 博客(0)
- 资源 (24)
空空如也
Blending of Input Materials.pdf
Blending of Input Materials
这是lingo系列之10
有了这套lingo教程,立即便会成为高手哦
2009-06-11
Matlab - Optimisation Toolbox - User's Guide.pdf
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3
Problems Covered by the Toolbox . . . . . . . . . . . . . . . . . . . . . . . . 2-3
Using the Optimization Functions . . . . . . . . . . . . . . . . . . . . . . . 2-5
ii Contents
Examples that Use Standard Algorithms . . . . . . . . . . . . . . . . 2-7
Unconstrained Minimization Example . . . . . . . . . . . . . . . . . . . . 2-8
Nonlinear Inequality Constrained Example . . . . . . . . . . . . . . . 2-9
Constrained Example with Bounds . . . . . . . . . . . . . . . . . . . . . 2-11
Constrained Example with Gradients . . . . . . . . . . . . . . . . . . . 2-12
Gradient Check: Analytic Versus Numeric . . . . . . . . . . . . . . . 2-14
Equality Constrained Example . . . . . . . . . . . . . . . . . . . . . . . . . 2-15
Maximization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-16
Greater-Than-Zero Constraints . . . . . . . . . . . . . . . . . . . . . . . . 2-16
Additional Arguments: Avoiding Global Variables . . . . . . . . . 2-16
Nonlinear Equations with Analytic Jacobian . . . . . . . . . . . . . . 2-17
Nonlinear Equations with Finite-Difference Jacobian . . . . . . 2-20
Multiobjective Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-21
Large-Scale Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-33
Problems Covered by Large-Scale Methods . . . . . . . . . . . . . . . 2-34
Nonlinear Equations with Jacobian . . . . . . . . . . . . . . . . . . . . . 2-37
Nonlinear Equations with Jacobian Sparsity Pattern . . . . . . . 2-39
Nonlinear Least-Squares with Full Jacobian Sparsity
Pattern . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-41
Nonlinear Minimization with Gradient and Hessian . . . . . . . 2-43
Nonlinear Minimization with Gradient and Hessian Sparsity
Pattern . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-44
Nonlinear Minimization with Bound Constraints and Banded
Preconditioner . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-46
Nonlinear Minimization with Equality Constraints . . . . . . . . 2-50
Nonlinear Minimization with a Dense but Structured Hessian
and Equality Constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-51
Quadratic Minimization with Bound Constraints . . . . . . . . . . 2-55
Quadratic Minimization with a Dense but Structured
Hessian . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-57
Linear Least-Squares with Bound Constraints . . . . . . . . . . . . 2-60
Linear Programming with Equalities and Inequalities . . . . . . 2-61
Linear Programming with Dense Columns in the Equalities . 2-62
Default Parameter Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-65
Changing the Default Settings . . . . . . . . . . . . . . . . . . . . . . . . . 2-65
Displaying Iterative Output . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-68
Output Headings: Medium-Scale Algorithms . . . . . . . . . . . . . 2-68
iii
Output Headings: Large-Scale Algorithms . . . . . . . . . . . . . . . 2-71
Optimization of Inline Objects Instead of M-Files . . . . . . . 2-74
Typical Problems and How to Deal with Them . . . . . . . . . . 2-76
Converting Your Code to Version 2 Syntax . . . . . . . . . . . . . 2-80
Using optimset and optimget . . . . . . . . . . . . . . . . . . . . . . . . . . 2-81
New Calling Sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-81
Example of Converting from constr to fmincon . . . . . . . . . . . . 2-89
Selected Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-92
3
Standard Algorithms……
2009-06-11
Matlab 7 - Programming.pdf
该书是系统介绍了MATLAB的所有function功能,可以说是一本programming大全,而且还是英文版,值得收藏,而且敝人还打印了一份,正在苦学之中……
Creating and Concatenating Matrices . . . . . . . . . . . . . . . . . . 1-3
Constructing a Simple Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4
Specialized Matrix Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4
Concatenating Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-7
Matrix Concatenation Functions . . . . . . . . . . . . . . . . . . . . . . . . 1-8
Generating a Numeric Sequence . . . . . . . . . . . . . . . . . . . . . . . 1-10
Combining Unlike Data Types . . . . . . . . . . . . . . . . . . . . . . . . . 1-11
Accessing Elements of a Matrix . . . . . . . . . . . . . . . . . . . . . . . 1-14
Accessing Single Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-14
Linear Indexing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-15
Functions That Control Indexing Style . . . . . . . . . . . . . . . . . . 1-16
Accessing Multiple Elements . . . . . . . . . . . . . . . . . . . . . . . . . . 1-16
Logical Indexing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-18
Getting Information About a Matrix . . . . . . . . . . . . . . . . . . . 1-19
Dimensions of the Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-19
Data Types Used in the Matrix . . . . . . . . . . . . . . . . . . . . . . . . 1-20
Data Structures Used in the Matrix . . . . . . . . . . . . . . . . . . . . 1-21
Resizing and Reshaping Matrices . . . . . . . . . . . . . . . . . . . . . 1-22
Expanding the Size of a Matrix . . . . . . . . . . . . . . . . . . . . . . . . 1-22
Diminishing the Size of a Matrix . . . . . . . . . . . . . . . . . . . . . . . 1-23
Reshaping a Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-24
Shifting and Sorting Matrices . . . . . . . . . . . . . . . . . . . . . . . . . 1-26
Shift and Sort Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-26
Shifting the Location of Matrix Elements . . . . . . . . . . . . . . . . 1-26
Sorting the Data in Each Column . . . . . . . . . . . . . . . . . . . . . . 1-28
Sorting the Data in Each Row . . . . . . . . . . . . . . . . . . . . . . . . . 1-28
Sorting Row Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-29
Operating on Diagonal Matrices . . . . . . . . . . . . . . . . . . . . . . . 1-30
Constructing a Matrix from a Diagonal Vector . . . . . . . . . . . . 1-30
Returning a Triangular Portion of a Matrix . . . . . . . . . . . . . . . 1-31
Concatenating Matrices Diagonally . . . . . . . . . . . . . . . . . . . . . 1-31
Empty Matrices, Scalars, and Vectors . . . . . . . . . . . . . . . . . . 1-32
The Empty Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-32
Scalars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-33
Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-34
Full and Sparse Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-35
Sparse Matrix Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-35
Multidimensional Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-37
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-37
Creating Multidimensional Arrays . . . . . . . . . . . . . . . . . . . . . . 1-39
Accessing Multidimensional Array Properties . . . . . . . . . . . . . 1-43
Indexing Multidimensional Arrays . . . . . . . . . . . . . . . . . . . . . . 1-43
Reshaping Multidimensional Arrays . . . . . . . . . . . . . . . . . . . . 1-47
Permuting Array Dimensions . . . . . . . . . . . . . . . . . . . . . . . . . . 1-49
Computing with Multidimensional Arrays . . . . . . . . . . . . . . . . 1-51
Organizing Data in Multidimensional Arrays . . . . . . . . . . . . . 1-53
Multidimensional Cell Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . 1-55
Multidimensional Structure Arrays . . . . . . . . . . . . . . . . . . . . . 1-56
Summary of Matrix and Array Functions . . . . . . . . . . . . . . . 1-58
2
Data Types
Overview of MATLAB Data Types . . . . . . . . . . . . . . . . . . . . . . 2-2
Numeric Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4
Integers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4
Floating-Point Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-6
Complex Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-11
Infinity and NaN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-12
iii
Identifying Numeric Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-14
Display Format for Numeric Values . . . . . . . . . . . . . . . . . . . . . 2-14
Function Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-16
Logical Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-20
Creating a Logical Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-20
How Logical Arrays Are Used . . . . . . . . . . . . . . . . . . . . . . . . . . 2-22
Identifying Logical Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-24
Characters and Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-25
Creating Character Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-25
Cell Arrays of Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-27
String Comparisons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-29
Searching and Replacing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-32
Converting from Numeric to String . . . . . . . . . . . . . . . . . . . . . 2-34
Converting from String to Numeric . . . . . . . . . . . . . . . . . . . . . 2-35
Function Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-37
Dates and Times . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-41
Types of Date Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-41
Conversions Between Date Formats . . . . . . . . . . . . . . . . . . . . . 2-43
Date String Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-44
Output Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-44
Current Date and Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-46
Function Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-47
Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-49
Building Structure Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-50
Accessing Data in Structure Arrays . . . . . . . . . . . . . . . . . . . . . 2-53
Using Dynamic Field Names . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-54
Finding the Size of Structure Arrays . . . . . . . . . . . . . . . . . . . . 2-55
Adding Fields to Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-56
Deleting Fields from Structures . . . . . . . . . . . . . . . . . . . . . . . . 2-56
Applying Functions and Operators . . . . . . . . . . . . . . . . . . . . . . 2-56
Writing Functions to Operate on Structures . . . . . . . . . . . . . . 2-57
Organizing Data in Structure Arrays . . . . . . . . . . . . . . . . . . . . 2-59
Nesting Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-63
Function Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-65
iv Contents
Cell Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-66
Creating Cell Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-67
Obtaining Data from Cell Arrays . . . . . . . . . . . . . . . . . . . . . . . 2-70
Deleting Cells . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-71
Reshaping Cell Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-72
Replacing Lists of Variables with Cell Arrays . . . . . . . . . . . . . 2-72
Applying Functions and Operators . . . . . . . . . . . . . . . . . . . . . . 2-74
Organizing Data in Cell Arrays . . . . . . . . . . . . . . . . . . . . . . . . 2-74
Nesting Cell Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-75
Converting Between Cell and Numeric Arrays . . . . . . . . . . . . 2-77
Cell Arrays of Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-78
Function Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-79
Function Handles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-80
Constructing and Invoking a Function Handle . . . . . . . . . . . . 2-80
Calling a Function Using Its Handle . . . . . . . . . . . . . . . . . . . . 2-80
Simple Function Handle Example . . . . . . . . . . . . . . . . . . . . . . 2-81
MATLAB Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-82
Java Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-83
3
Basic Program Components
Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
Types of Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
Naming Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6
Guidelines to Using Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7
Scope of a Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7
Lifetime of a Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8
Keywords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-9
Special Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-10
v
Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-12
Arithmetic Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-12
Relational Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-13
Logical Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-15
Operator Precedence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-20
MATLAB Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-22
String Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-22
Shell Escape Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-23
Regular Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-25
MATLAB Regular Expression Functions . . . . . . . . . . . . . . . . . 3-25
Elements of an Expression . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-26
Character Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-26
Character Representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-29
Logical Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-30
Lookaround Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-33
Quantifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-36
Tokens . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-40
Handling Multiple Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-46
Operator Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-49
Comma-Separated Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-54
Generating a List from a Cell Array . . . . . . . . . . . . . . . . . . . . . 3-54
Generating a List from a Structure . . . . . . . . . . . . . . . . . . . . . 3-55
How to Use the Comma-Separated List . . . . . . . . . . . . . . . . . . 3-56
Fast Fourier Transform Example . . . . . . . . . . . . . . . . . . . . . . . 3-58
Program Control Statements . . . . . . . . . . . . . . . . . . . . . . . . . . 3-60
Conditional Control — if, switch . . . . . . . . . . . . . . . . . . . . . . . . 3-60
Loop Control — for, while, continue, break . . . . . . . . . . . . . . . 3-64
Error Control — try, catch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-67
Program Termination — return . . . . . . . . . . . . . . . . . . . . . . . . 3-68
Symbol Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-69
Asterisk — * . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-70
At — @ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-70
Colon — : . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-71
Comma — , . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-72
vi Contents
Curly Braces — { } . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-73
Dot — . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-73
Dot-Dot — .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-74
Dot-Dot-Dot (Ellipsis) — ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-74
Dot-Parentheses — .( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-75
Exclamation Point — ! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-75
Parentheses — ( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-76
Percent — % . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-76
Percent-Brace — %{ %} . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-77
Semicolon — ; . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-77
Single Quotes — ' ' . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-78
Space Character . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-78
Slash and Backslash — / \ . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-79
Square Brackets — [ ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-79
MATLAB Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-81
M-File Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-81
Built-In Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-82
Overloaded MATLAB Functions . . . . . . . . . . . . . . . . . . . . . . . . 3-83
4
M-File Programming
Program Development . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2
Creating a Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2
Getting the Bugs Out . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3
Cleaning Up the Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4
Improving Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-5
Checking It In . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-6
Working with M-Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7
Types of M-Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7
Basic Parts of an M-File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-8
Creating a Simple M-File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-13
Providing Help for Your Program . . . . . . . . . . . . . . . . . . . . . . . 4-15
Creating P-Code Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-15
vii
M-File Scripts and Functions . . . . . . . . . . . . . . . . . . . . . . . . . . 4-16
M-File Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-16
M-File Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-17
Types of Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-18
Identifying Dependencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-19
Function Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-21
Checking the Number of Input Arguments . . . . . . . . . . . . . . . 4-21
Passing Variable Numbers of Arguments . . . . . . . . . . . . . . . . 4-23
Returning Output Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . 4-25
Function Handles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-27
Constructing a Function Handle . . . . . . . . . . . . . . . . . . . . . . . . 4-27
Calling a Function Using Its Handle . . . . . . . . . . . . . . . . . . . . 4-28
Functions That Operate on Function Handles . . . . . . . . . . . . . 4-29
Additional Information on Function Handles . . . . . . . . . . . . . 4-29
Calling Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-31
What Happens When You Call a Function . . . . . . . . . . . . . . . . 4-31
Determining Which Function Is Called . . . . . . . . . . . . . . . . . . 4-31
MATLAB Calling Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-34
Passing Certain Argument Types . . . . . . . . . . . . . . . . . . . . . . . 4-37
Passing Arguments in Structures or Cell Arrays . . . . . . . . . . . 4-39
Calling External Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-40
5
Types of Functions
Overview of MATLAB Function Types . . . . . . . . . . . . . . . . . . 5-2
Anonymous Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-3
Constructing an Anonymous Function . . . . . . . . . . . . . . . . . . . . 5-3
Arrays of Anonymous Functions . . . . . . . . . . . . . . . . . . . . . . . . . 5-5
Outputs from Anonymous Functions . . . . . . . . . . . . . . . . . . . . . 5-6
Variables Used in the Expression . . . . . . . . . . . . . . . . . . . . . . . . 5-8
Examples of Anonymous Functions . . . . . . . . . . . . . . . . . . . . . 5-11
viii Contents
Primary M-File Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-14
Nested Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-15
Writing Nested Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-15
Calling Nested Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-17
Variable Scope in Nested Functions . . . . . . . . . . . . . . . . . . . . . 5-18
Using Function Handles with Nested Functions . . . . . . . . . . . 5-20
Examples of Nested Functions . . . . . . . . . . . . . . . . . . . . . . . . . 5-25
Subfunctions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-31
Calling Subfunctions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-32
Accessing Help for a Subfunction . . . . . . . . . . . . . . . . . . . . . . . 5-32
Private Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-33
Private Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-33
Accessing Help for a Private Function . . . . . . . . . . . . . . . . . . . 5-33
Overloaded Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-34
Class Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-34
6
Data Import and Export
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3
Text Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3
Graphics Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3
Audio and Audio/Video Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4
Spreadsheets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4
Scientific Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4
The Internet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4
Low-Level File I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-5
Toolboxes for Importing Data . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-5
Using the Import Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-6
Using the Import Wizard with Text Data . . . . . . . . . . . . . . . . . 6-6
Using the Import Wizard with Binary Data . . . . . . . . . . . . . . . 6-12
ix
Supported File Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-15
Saving and Loading MAT-Files . . . . . . . . . . . . . . . . . . . . . . . . 6-17
Exporting Data to MAT-Files . . . . . . . . . . . . . . . . . . . . . . . . . . 6-17
Importing Data from MAT-Files . . . . . . . . . . . . . . . . . . . . . . . . 6-22
Importing Text Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-26
The MATLAB Import Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . 6-26
Using Import Functions with Text Data . . . . . . . . . . . . . . . . . 6-26
Importing Numeric Text Data . . . . . . . . . . . . . . . . . . . . . . . . . . 6-29
Importing Delimited ASCII Data Files . . . . . . . . . . . . . . . . . . . 6-30
Importing Numeric Data with Text Headers . . . . . . . . . . . . . . 6-30
Importing Mixed Alphabetic and Numeric Data . . . . . . . . . . . 6-31
Importing from XML Documents . . . . . . . . . . . . . . . . . . . . . . . 6-33
Exporting Text Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-34
Exporting Delimited ASCII Data Files . . . . . . . . . . . . . . . . . . . 6-35
Using the diary Function to Export Data . . . . . . . . . . . . . . . . . 6-37
Exporting to XML Documents . . . . . . . . . . . . . . . . . . . . . . . . . . 6-38
Working with Graphics Files . . . . . . . . . . . . . . . . . . . . . . . . . . 6-39
Getting Information About Graphics Files . . . . . . . . . . . . . . . . 6-39
Importing Graphics Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-40
Exporting Graphics Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-40
Working with Audio and Video Data . . . . . . . . . . . . . . . . . . . 6-42
Getting Information About Audio/Video Files . . . . . . . . . . . . . 6-42
Importing Audio/Video Data . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-43
Exporting Audio/Video Data . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-44
Working with Spreadsheets . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-46
Microsoft Excel Spreadsheets . . . . . . . . . . . . . . . . . . . . . . . . . . 6-46
Lotus 123 Spreadsheets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-49
Working with Scientific Data Formats . . . . . . . . . . . . . . . . . 6-52
Working with Common Data Format (CDF) Files . . . . . . . . . . 6-52
Working with Flexible Image Transport System (FITS) Files 6-55
Working with Hierarchical Data Format (HDF5) Files . . . . . . 6-57
x Contents
Importing HDF4 and HDF-EOS Data . . . . . . . . . . . . . . . . . . . 6-67
Using the HDF Import Tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-67
Using the HDF4 Import Tool Subsetting Options . . . . . . . . . . 6-72
Using the MATLAB hdfread Function . . . . . . . . . . . . . . . . . . . 6-82
Using the HDF4 Command-Line Interface . . . . . . . . . . . . . . . 6-86
Exporting MATLAB Data to an HDF4 File . . . . . . . . . . . . . . 6-94
Example: Exporting Data to an HDF4 File . . . . . . . . . . . . . . . 6-94
Using the MATLAB HDF Utility API . . . . . . . . . . . . . . . . . . . 6-101
Using Low-Level File I/O Functions . . . . . . . . . . . . . . . . . . . 6-103
Opening Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-104
Reading Binary Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-106
Writing Binary Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-108
Controlling Position in a File . . . . . . . . . . . . . . . . . . . . . . . . . 6-108
Reading Strings Line by Line from Text Files . . . . . . . . . . . . 6-110
Reading Formatted ASCII Data . . . . . . . . . . . . . . . . . . . . . . . 6-112
Writing Formatted Text Files . . . . . . . . . . . . . . . . . . . . . . . . . 6-113
Closing a File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-114
Exchanging Files over the Internet . . . . . . . . . . . . . . . . . . . 6-116
Downloading Web Content and Files . . . . . . . . . . . . . . . . . . . 6-116
Creating and Uncompressing Zip Archives . . . . . . . . . . . . . . 6-118
Sending E-Mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-119
Performing FTP File Operations . . . . . . . . . . . . . . . . . . . . . . . 6-121
7
Error Handling
Checking for Errors with try-catch . . . . . . . . . . . . . . . . . . . . . 7-2
Nested try-catch Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-3
Handling and Recovering from an Error . . . . . . . . . . . . . . . . 7-4
Reporting an Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-4
Identifying the Cause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-5
Regenerating an Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-7
xi
Message Identifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-8
Identifier Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-8
Using Message Identifiers with lasterr . . . . . . . . . . . . . . . . . . . 7-9
Warnings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-12
Reporting a Warning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-12
Identifying the Cause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-13
Warning Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-14
Warning Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-14
Warning Control Statements . . . . . . . . . . . . . . . . . . . . . . . . . . 7-15
Output from Control Statements . . . . . . . . . . . . . . . . . . . . . . . 7-17
Saving and Restoring State . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-20
Debug, Backtrace, and Verbose Modes . . . . . . . . . . . . . . . . . . . 7-21
Debugging Errors and Warnings . . . . . . . . . . . . . . . . . . . . . . 7-23
8
Classes and Objects
Classes and Objects: An Overview . . . . . . . . . . . . . . . . . . . . . . 8-2
Features of Object-Oriented Programming . . . . . . . . . . . . . . . . 8-2
MATLAB Data Class Hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . 8-3
Creating Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-4
Invoking Methods on Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-4
Private Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-5
Helper Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-5
Debugging Class Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-5
Setting Up Class Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-6
Data Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-7
Tips for C++ and Java Programmers . . . . . . . . . . . . . . . . . . . . . 8-7
Designing User Classes in MATLAB . . . . . . . . . . . . . . . . . . . . . 8-9
The MATLAB Canonical Class . . . . . . . . . . . . . . . . . . . . . . . . . . 8-9
The Class Constructor Method . . . . . . . . . . . . . . . . . . . . . . . . . 8-10
Examples of Constructor Methods . . . . . . . . . . . . . . . . . . . . . . 8-11
Identifying Objects Outside the Class Directory . . . . . . . . . . . 8-11
xii Contents
The display Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-12
Accessing Object Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-13
The set and get Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-13
Indexed Reference Using subsref and subsasgn . . . . . . . . . . . 8-14
Handling Subscripted Reference . . . . . . . . . . . . . . . . . . . . . . . . 8-15
Handling Subscripted Assignment . . . . . . . . . . . . . . . . . . . . . . 8-17
Object Indexing Within Methods . . . . . . . . . . . . . . . . . . . . . . . 8-18
Defining end Indexing for an Object . . . . . . . . . . . . . . . . . . . . . 8-19
Indexing an Object with Another Object . . . . . . . . . . . . . . . . . 8-19
Converter Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-20
Overloading Operators and Functions . . . . . . . . . . . . . . . . . 8-21
Overloading Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-21
Overloading Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-23
Example — A Polynomial Class . . . . . . . . . . . . . . . . . . . . . . . . 8-24
Polynom Data Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-24
Polynom Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-24
The Polynom Constructor Method . . . . . . . . . . . . . . . . . . . . . . 8-24
Converter Methods for the Polynom Class . . . . . . . . . . . . . . . . 8-25
The Polynom display Method . . . . . . . . . . . . . . . . . . . . . . . . . . 8-28
The Polynom subsref Method . . . . . . . . . . . . . . . . . . . . . . . . . . 8-28
Overloading Arithmetic Operators for polynom . . . . . . . . . . . . 8-29
Overloading Functions for the Polynom Class . . . . . . . . . . . . . 8-31
Listing Class Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-33
Building on Other Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-35
Simple Inheritance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-35
Multiple Inheritance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-36
Aggregation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-37
Example — Assets and Asset Subclasses . . . . . . . . . . . . . . . . 8-38
Inheritance Model for the Asset Class . . . . . . . . . . . . . . . . . . . 8-38
Asset Class Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-39
Other Asset Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-39
The Asset Constructor Method . . . . . . . . . . . . . . . . . . . . . . . . . 8-39
The Asset get Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-41
The Asset set Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-41
The Asset subsref Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-42
The Asset subsasgn Method . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-43
xiii
The Asset display Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-44
The Asset fieldcount Method . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-45
Designing the Stock Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-45
The Stock Constructor Method . . . . . . . . . . . . . . . . . . . . . . . . . 8-46
The Stock get Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-48
The Stock set Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-49
The Stock subsref Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-50
The Stock subsasgn Method . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-51
The Stock display Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-53
Example — The Portfolio Container . . . . . . . . . . . . . . . . . . . 8-54
Designing the Portfolio Class . . . . . . . . . . . . . . . . . . . . . . . . . . 8-54
The Portfolio Constructor Method . . . . . . . . . . . . . . . . . . . . . . 8-55
The Portfolio display Method . . . . . . . . . . . . . . . . . . . . . . . . . . 8-56
The Portfolio pie3 Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-57
Creating a Portfolio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-58
Saving and Loading Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-60
Modifying Objects During Save or Load . . . . . . . . . . . . . . . . . . 8-60
Example — Defining saveobj and loadobj for Portfolio . . 8-61
Summary of Code Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-61
The saveobj Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-62
The loadobj Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-62
Changing the Portfolio Constructor . . . . . . . . . . . . . . . . . . . . . 8-63
The Portfolio subsref Method . . . . . . . . . . . . . . . . . . . . . . . . . . 8-64
Object Precedence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-65
Specifying Precedence of User-Defined Classes . . . . . . . . . . . . 8-66
How MATLAB Determines Which Method to Call . . . . . . . 8-67
Selecting a Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-67
Querying Which Method MATLAB Will Call . . . . . . . . . . . . . . 8-70
2009-06-11
Matlab - Math Problems solving with Matlab Programming.pdf
1 Engineering Problem Solving 1
1.1 Problem-Solving Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 ProblemSolving Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3 Computing Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.4 Computing Terminology. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2 Matlab Technical Computing Environment 14
2.1 Workspace,Windows, and Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.2 ScalarMathematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.3 BasicMathematical Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2.4 Computational Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.5 Display Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.6 Accuracyand Precision . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3 Files and File Management 37
3.1 FileManagement Definitions and Commands . . . . . . . . . . . . . . . . . . . . . . 37
3.2 Saving and RestoringMatlab Information . . . . . . . . . . . . . . . . . . . . . . . . 39
3.3 ScriptM-Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
3.4 Errors and Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
3.5 Matlab Search Path, PathManagement, and Startup . . . . . . . . . . . . . . . . . . 49
i
4 Trigonometry and ComplexNum bers 51
4.1 Trigonometry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
4.2 Complex Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
4.3 Two-Dimensional Plotting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
5 Arrays and Array Operations 81
5.1 Vector Array s. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
5.2 Matrix Array s. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
5.3 ArrayPlotting Capabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
6 Mathematical Functions and Applications 101
6.1 Signal Representation, Processing, and Plotting . . . . . . . . . . . . . . . . . . . . . 101
6.2 Poly nomials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
6.3 Partial Fraction Expansion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
6.4 Functions of Two Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
6.5 User-Defined Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
6.6 Plotting Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
7 DataAnalysis 135
7.1 Maximum andMinimum. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
7.2 Sums and Products . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
7.3 Statistical Analy sis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
7.4 Random Number Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
8 Selection Programming 155
8.1 Relational and Logical Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
8.2 Flow Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
8.3 Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
8.4 Selection Statements in User-Defined Functions . . . . . . . . . . . . . . . . . . . . . 169
8.5 Update Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
ii
8.6 Applied ProblemSolving: Speech Signal Analy sis . . . . . . . . . . . . . . . . . . . . 175
9 Vectors, Matrices and Linear Algebra 180
9.1 Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
9.2 Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
9.3 Solutions to Sy stems of Linear Equations . . . . . . . . . . . . . . . . . . . . . . . . 196
9.4 Applied ProblemSolving: RobotMotion . . . . . . . . . . . . . . . . . . . . . . . . . 202
10 Curve Fitting and Interpolation 207
10.1 MinimumMean-Square Error Curve Fitting . . . . . . . . . . . . . . . . . . . . . . . 207
10.2 Applied Problem Solving: Hydraulic Engineering . . . . . . . . . . . . . . . . . . . . 213
10.3 Interpolation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
10.4 Applied ProblemSolving: Human Hearing . . . . . . . . . . . . . . . . . . . . . . . . 219
11 Integration and Differentiation 223
11.1 Numerical Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
11.2 Numerical Differentiation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
12 Strings, Time, Base Conversion and Bit Operations 239
12.1 Character Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
12.2 Time Computations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
12.3 Base Conversions and Bit Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
13 Symbolic Processing 250
13.1 Sy mbolic Expressions and Algebra . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
13.2 Manipulating Trigonometric Expressions . . . . . . . . . . . . . . . . . . . . . . . . . 257
13.3 Evaluating and Plotting Sy mbolic Expressions . . . . . . . . . . . . . . . . . . . . . 258
13.4 Solving Algebraic and Transcendental Equations . . . . . . . . . . . . . . . . . . . . 259
13.5 Calculus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
13.6 Linear Algebra . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
2009-06-11
Great Science Textbooks DVD Library 2007 - Supplement Seven\Economics
Great Science Textbooks DVD Library 2007 - Supplement Seven\Economics
2009-04-24
Great Science Textbooks DVD Library 2007 - Supplement Seven\Economics
Great Science Textbooks DVD Library 2007 - Supplement Seven\Economics
2009-04-24
Great Science Textbooks DVD Library 2007 - Supplement Seven\Economics
Great Science Textbooks DVD Library 2007 - Supplement Seven\Economics
2009-04-24
Great Science Textbooks DVD Library 2007 - Supplement Seven\Economics
Great Science Textbooks DVD Library 2007 - Supplement Seven\Economics
11.9MB
2009-04-24
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人