Preface |
|
v | |
Introduction |
|
1 | (4) |
|
Chapter 1 Starting with MATLAB |
|
|
5 | (30) |
|
1.1 Starting MATLAB, MATLAB Windows |
|
|
5 | (4) |
|
1.2 Working in the Command Window |
|
|
9 | (2) |
|
1.3 Arithmetic Operations with Scalars |
|
|
11 | (1) |
|
1.3.1 Order of Precedence |
|
|
11 | (1) |
|
1.3.2 Using MATLAB as a Calculator |
|
|
12 | (1) |
|
|
12 | (2) |
|
1.5 Elementary Math Built-in Functions |
|
|
14 | (2) |
|
1.6 Defining Scalar Variables |
|
|
16 | (3) |
|
1.6.1 The Assignment Operator |
|
|
16 | (2) |
|
1.6.2 Rules About Variable Names |
|
|
18 | (1) |
|
1.6.3 Predefined Variables and Keywords |
|
|
19 | (1) |
|
1.7 Useful Commands for Managing Variables |
|
|
19 | (1) |
|
|
20 | (4) |
|
1.8.1 Notes About Script Files |
|
|
20 | (1) |
|
1.8.2 Creating and Saving a Script File |
|
|
21 | (1) |
|
1.8.3 Running (Executing) a Script File |
|
|
22 | (1) |
|
|
22 | (2) |
|
1.9 Examples of MATLAB Applications |
|
|
24 | (3) |
|
|
27 | (8) |
|
Chapter 2 Creating Arrays |
|
|
35 | (28) |
|
2.1 Creating a One-Dimensional Array (Vector) |
|
|
35 | (4) |
|
2.2 Creating a Two-Dimensional Array (Matrix) |
|
|
39 | (2) |
|
2.2.1 The zeros, ones and eye Commands |
|
|
40 | (1) |
|
2.3 Notes About Variables in MATLAB |
|
|
41 | (1) |
|
2.4 The Transpose Operator |
|
|
41 | (1) |
|
|
42 | (2) |
|
|
42 | (1) |
|
|
43 | (1) |
|
2.6 Using a Colon in Addressing Arrays |
|
|
44 | (2) |
|
2.7 Adding Elements to Existing Variables |
|
|
46 | (2) |
|
|
48 | (1) |
|
2.9 Built-in Functions for Handling Arrays |
|
|
49 | (4) |
|
2.10 Strings and Strings as Variables |
|
|
53 | (2) |
|
|
55 | (8) |
|
Chapter 3 Mathematical Operations with Arrays |
|
|
63 | (32) |
|
3.1 Addition and Subtraction |
|
|
64 | (1) |
|
|
65 | (3) |
|
|
68 | (4) |
|
3.4 Element-by-Element Operations |
|
|
72 | (3) |
|
3.5 Using Arrays in matlab Built-in Math Functions |
|
|
75 | (1) |
|
3.6 Built-in Functions for Analyzing Arrays |
|
|
75 | (2) |
|
3.7 Generation of Random Numbers |
|
|
77 | (3) |
|
3.8 Examples of matlab Applications |
|
|
80 | (6) |
|
|
86 | (9) |
|
Chapter 4 Using Script Files and Managing Data |
|
|
95 | (38) |
|
4.1 The matlab workspace and the workspace window |
|
|
96 | (1) |
|
4.2 Input to a Script File |
|
|
97 | (3) |
|
|
100 | (11) |
|
|
101 | (2) |
|
4.3.2 The fprintf Command |
|
|
103 | (8) |
|
4.4 The save and load Commands |
|
|
111 | (3) |
|
|
111 | (1) |
|
|
112 | (2) |
|
4.5 Importing and Exporting Data |
|
|
114 | (4) |
|
4.5.1 Commands for Importing and Exporting Data |
|
|
114 | (2) |
|
4.5.2 Using the Import Wizard |
|
|
116 | (2) |
|
4.6 Examples of MATLAB Applications |
|
|
118 | (5) |
|
|
123 | (10) |
|
Chapter 5 Two-Dimensional Plots |
|
|
133 | (42) |
|
|
134 | (6) |
|
|
138 | (1) |
|
|
139 | (1) |
|
|
140 | (1) |
|
5.3 Plotting Multiple Graphs in the Same Plot |
|
|
141 | (3) |
|
5.3.1 Using the plot Command |
|
|
141 | (1) |
|
5.3.2 Using the hold on and hold off Commands |
|
|
142 | (1) |
|
5.3.3 Using the line Command |
|
|
143 | (1) |
|
|
144 | (5) |
|
5.4.1 Formatting a Plot Using Commands |
|
|
144 | (4) |
|
5.4.2 Formatting a Plot Using the Plot Editor |
|
|
148 | (1) |
|
5.5 Plots with Logarithmic Axes |
|
|
149 | (1) |
|
5.6 Plots with Error Bars |
|
|
150 | (2) |
|
5.7 Plots with Special Graphics |
|
|
152 | (1) |
|
|
153 | (3) |
|
|
156 | (1) |
|
5.10 Putting Multiple Plots on the Same Page |
|
|
157 | (1) |
|
5.11 Multiple Figure Windows |
|
|
157 | (2) |
|
5.12 Plotting Using the Plots Toolstrip |
|
|
159 | (1) |
|
5.13 Examples of matlab Applications |
|
|
160 | (5) |
|
|
165 | (10) |
|
Chapter 6 Programming in MATLAB |
|
|
175 | (46) |
|
6.1 Relational and Logical Operators |
|
|
176 | (8) |
|
6.2 Conditional Statements |
|
|
184 | (5) |
|
6.2.1 The if-end Structure |
|
|
184 | (2) |
|
6.2.2 The if-else-end Structure |
|
|
186 | (1) |
|
6.2.3 The if-elseif-else-end Structure |
|
|
187 | (2) |
|
6.3 The switch-case Statement |
|
|
189 | (3) |
|
|
192 | (8) |
|
|
192 | (5) |
|
|
197 | (3) |
|
6.5 Nested Loops and Nested Conditional Statements |
|
|
200 | (2) |
|
6.6 The break and continue Commands |
|
|
202 | (1) |
|
6.7 Examples of MATLAB Applications |
|
|
203 | (8) |
|
|
211 | (10) |
|
Chapter 7 User-Defined Functions and Function Files |
|
|
221 | (40) |
|
7.1 Creating a Function File |
|
|
222 | (1) |
|
7.2 Structure of a Function File |
|
|
223 | (3) |
|
7.2.1 Function Definition Line |
|
|
224 | (1) |
|
7.2.2 Input and Output Arguments |
|
|
224 | (2) |
|
7.2.3 The H1 Line and Help Text Lines |
|
|
226 | (1) |
|
|
226 | (1) |
|
7.3 Local and Global Variables |
|
|
226 | (1) |
|
7.4 Saving a Function File |
|
|
227 | (1) |
|
7.5 Using a User-Defined Function |
|
|
228 | (1) |
|
7.6 Examples of Simple User-Defined Functions |
|
|
229 | (2) |
|
7.7 Comparison between Script Files and Function Files |
|
|
231 | (1) |
|
|
231 | (3) |
|
|
234 | (6) |
|
7.9.1 Using Function Handles for Passing a Function into a Function Function |
|
|
235 | (3) |
|
7.9.2 Using a Function Name for Passing a Function into a Function Function |
|
|
238 | (2) |
|
|
240 | (2) |
|
|
242 | (3) |
|
7.12 Examples of MATLAB Applications |
|
|
245 | (3) |
|
|
248 | (13) |
|
Chapter 8 Polynomials, Curve Fitting, and Interpolation |
|
|
261 | (34) |
|
|
261 | (6) |
|
8.1.1 Value of a Polynomial |
|
|
262 | (1) |
|
8.1.2 Roots of a Polynomial |
|
|
263 | (1) |
|
8.1.3 Addition, Multiplication, and Division of Polynomials |
|
|
264 | (2) |
|
8.1.4 Derivatives of Polynomials |
|
|
266 | (1) |
|
|
267 | (7) |
|
8.2.1 Curve Fitting with Polynomials; The polyfit Function |
|
|
267 | (4) |
|
8.2.2 Curve Fitting with Functions Other than Polynomials |
|
|
271 | (3) |
|
|
274 | (4) |
|
8.4 The Basic Fitting Interface |
|
|
278 | (3) |
|
8.5 Examples of MATLAB Applications |
|
|
281 | (5) |
|
|
286 | (9) |
|
Chapter 9 Applications in Numerical Analysis |
|
|
295 | (28) |
|
9.1 Solving an Equation with One Variable |
|
|
295 | (3) |
|
9.2 Finding a Minimum or a Maximum of a Function |
|
|
298 | (2) |
|
9.3 Numerical Integration |
|
|
300 | (3) |
|
9.4 Ordinary Differential Equations |
|
|
303 | (4) |
|
9.5 Examples of MATLAB Applications |
|
|
307 | (6) |
|
|
313 | (10) |
|
Chapter 10 Three-Dimensional Plots |
|
|
323 | (24) |
|
|
323 | (1) |
|
10.2 Mesh and Surface Plots |
|
|
324 | (7) |
|
10.3 Plots with Special Graphics |
|
|
331 | (2) |
|
|
333 | (3) |
|
10.5 Examples of MATLAB Applications |
|
|
336 | (5) |
|
|
341 | (6) |
|
|
347 | (46) |
|
11.1 Symbolic Objects and Symbolic Expressions |
|
|
348 | (6) |
|
11.1.1 Creating Symbolic Objects |
|
|
348 | (2) |
|
11.1.2 Creating Symbolic Expressions |
|
|
350 | (3) |
|
11.1.3 The findsym Command and the Default Symbolic Variable |
|
|
353 | (1) |
|
11.2 Changing the Form of an Existing Symbolic Expression |
|
|
354 | (4) |
|
11.2.1 The collect, expand, and factor Commands |
|
|
354 | (2) |
|
11.2.2 The simplify and simple Commands |
|
|
356 | (1) |
|
11.2.3 The pretty Command |
|
|
357 | (1) |
|
11.3 Solving Algebraic Equations |
|
|
358 | (5) |
|
|
363 | (2) |
|
|
365 | (1) |
|
11.6 Solving an Ordinary Differential Equation |
|
|
366 | (3) |
|
11.7 Plotting Symbolic Expressions |
|
|
369 | (3) |
|
11.8 Numerical Calculations with Symbolic Expressions |
|
|
372 | (4) |
|
11.9 Examples of MATLAB Applications |
|
|
376 | (8) |
|
|
384 | (9) |
Appendix: Summary of Characters, Commands, and Functions |
|
393 | (8) |
Answers to Selected Problems www.wiley.com/college/gilat |
|
Index |
|
401 | |