About The Authors |
|
xv | |
Preface |
|
xvii | |
Acknowledgments |
|
xxiii | |
|
Chapter 1 Introduction to computer programming and MATLAB® |
|
|
1 | (34) |
|
|
1 | (1) |
|
1.2 Computers and computer programming |
|
|
2 | (1) |
|
|
3 | (1) |
|
1.4 The MATLAB environment |
|
|
4 | (2) |
|
|
6 | (1) |
|
1.6 Variables, arrays, and simple operations |
|
|
6 | (6) |
|
|
6 | (1) |
|
|
7 | (1) |
|
1.6.3 Built-in MATLAB functions |
|
|
8 | (1) |
|
1.6.4 Creating and manipulating arrays |
|
|
8 | (2) |
|
1.6.5 Regularly-spaced arrays |
|
|
10 | (1) |
|
1.6.6 Accessing array elements |
|
|
10 | (1) |
|
|
11 | (1) |
|
|
12 | (4) |
|
|
16 | (2) |
|
1.9 Loading and saving data |
|
|
18 | (1) |
|
|
19 | (2) |
|
|
21 | (1) |
|
|
22 | (3) |
|
|
25 | (1) |
|
|
26 | (3) |
|
|
26 | (2) |
|
1.14.2 MATLAB code analyzer |
|
|
28 | (1) |
|
|
29 | (1) |
|
|
30 | (1) |
|
|
30 | (5) |
|
Chapter 2 Control structures |
|
|
35 | (28) |
|
|
35 | (1) |
|
2.2 Conditional if statements |
|
|
35 | (4) |
|
2.3 Comparison/logical operators |
|
|
39 | (3) |
|
2.4 Conditional switch statements |
|
|
42 | (3) |
|
|
45 | (4) |
|
2.6 Iteration: while loops |
|
|
49 | (2) |
|
2.7 A note about efficiency |
|
|
51 | (1) |
|
|
52 | (2) |
|
2.9 Nesting control structures |
|
|
54 | (1) |
|
|
55 | (1) |
|
|
55 | (1) |
|
|
55 | (8) |
|
Chapter 3 Basic data types |
|
|
63 | (30) |
|
|
63 | (1) |
|
|
63 | (1) |
|
|
64 | (9) |
|
3.4 The Boolean data type |
|
|
73 | (2) |
|
|
74 | (1) |
|
3.5 Characters and character arrays |
|
|
75 | (6) |
|
|
78 | (2) |
|
3.5.2 Built-in MATLAB functions |
|
|
80 | (1) |
|
3.6 Identifying the type of a variable |
|
|
81 | (1) |
|
3.7 Converting between types |
|
|
82 | (5) |
|
3.7.1 Converting between a number and a character |
|
|
82 | (1) |
|
3.7.2 Converting between a number and a logical type |
|
|
83 | (1) |
|
|
84 | (3) |
|
|
87 | (1) |
|
|
87 | (1) |
|
|
88 | (5) |
|
|
93 | (30) |
|
|
93 | (1) |
|
|
93 | (6) |
|
|
99 | (2) |
|
4.4 Function m-files and script m-files |
|
|
101 | (2) |
|
|
103 | (1) |
|
4.6 A function m-file can contain more than one function |
|
|
104 | (1) |
|
4.7 Script m-files and functions |
|
|
105 | (1) |
|
4.8 M-files and the MATLAB search path |
|
|
106 | (2) |
|
|
108 | (1) |
|
|
108 | (3) |
|
4.11 Recursion: a function calling itself |
|
|
111 | (1) |
|
|
112 | (1) |
|
|
113 | (1) |
|
|
113 | (10) |
|
Chapter 5 Program development and testing |
|
|
123 | (28) |
|
|
123 | (1) |
|
5.2 Incremental development |
|
|
123 | (7) |
|
5.3 Are we finished? Validating user input |
|
|
130 | (1) |
|
|
131 | (7) |
|
5.5 Common reasons for errors when running a script or a function |
|
|
138 | (1) |
|
|
139 | (2) |
|
5.6.1 The error and warning functions |
|
|
139 | (1) |
|
5.6.2 The try and catch method |
|
|
140 | (1) |
|
|
141 | (1) |
|
|
141 | (1) |
|
|
142 | (9) |
|
Chapter 6 Advanced data types |
|
|
151 | (24) |
|
|
151 | (1) |
|
6.2 Cells and cell arrays |
|
|
151 | (4) |
|
|
155 | (3) |
|
|
158 | (3) |
|
|
161 | (2) |
|
|
163 | (5) |
|
6.7 Conversion of advanced data types |
|
|
168 | (1) |
|
|
168 | (1) |
|
|
169 | (1) |
|
|
169 | (6) |
|
Chapter 7 File input/output |
|
|
175 | (20) |
|
|
175 | (1) |
|
7.2 Recap on basic input/output functions |
|
|
175 | (1) |
|
7.3 Simple functions for dealing with text files |
|
|
176 | (2) |
|
|
178 | (9) |
|
|
187 | (3) |
|
|
190 | (1) |
|
|
191 | (1) |
|
|
191 | (4) |
|
|
195 | (16) |
|
|
195 | (1) |
|
|
196 | (7) |
|
8.2.1 Incremental development and test stubs |
|
|
202 | (1) |
|
|
203 | (1) |
|
|
204 | (1) |
|
8.5 Alternative design approaches |
|
|
204 | (1) |
|
|
205 | (1) |
|
|
206 | (1) |
|
|
206 | (5) |
|
|
211 | (22) |
|
|
211 | (1) |
|
|
211 | (15) |
|
|
212 | (1) |
|
9.2.2 Visualizing multiple datasets |
|
|
213 | (4) |
|
|
217 | (4) |
|
9.2.4 The meshgrid command |
|
|
221 | (2) |
|
9.2.5 Modifying axis limits |
|
|
223 | (1) |
|
|
224 | (2) |
|
|
226 | (1) |
|
|
227 | (1) |
|
|
227 | (6) |
|
Chapter 10 Code efficiency |
|
|
233 | (28) |
|
|
233 | (1) |
|
10.2 Time and memory efficiency |
|
|
233 | (5) |
|
10.2.1 Timing commands in MATLAB |
|
|
235 | (1) |
|
10.2.2 Assessing memory efficiency |
|
|
236 | (2) |
|
10.3 Tips for improving time-efficiency |
|
|
238 | (7) |
|
10.3.1 Pre-allocating arrays |
|
|
238 | (1) |
|
|
239 | (3) |
|
|
242 | (2) |
|
10.3.4 A few more tips for efficient code |
|
|
244 | (1) |
|
10.4 Recursive and dynamic programming |
|
|
245 | (6) |
|
10.4.1 A note on the depth of recursive function calls |
|
|
250 | (1) |
|
10.5 Dynamic programming to improve performance |
|
|
251 | (2) |
|
|
253 | (1) |
|
|
254 | (1) |
|
|
254 | (7) |
|
Chapter 11 Signal and image processing |
|
|
261 | (34) |
|
|
261 | (1) |
|
11.2 Storing and reading 1-D signals |
|
|
262 | (1) |
|
11.3 Processing 1-D signals |
|
|
263 | (1) |
|
|
264 | (8) |
|
11.4.1 Convolution: more detail |
|
|
269 | (3) |
|
11.5 Storing and reading image data |
|
|
272 | (1) |
|
11.6 Accessing images in MATLAB |
|
|
273 | (4) |
|
11.6.1 Color versus gray scale images |
|
|
273 | (1) |
|
11.6.2 Getting information about an image |
|
|
273 | (2) |
|
|
275 | (1) |
|
11.6.4 Accessing the pixel data for an image |
|
|
276 | (1) |
|
11.6.5 Viewing and saving a sub-region of an image |
|
|
276 | (1) |
|
|
277 | (5) |
|
11.7.1 Binarizing a gray scale image and saving. the result |
|
|
277 | (2) |
|
11.7.2 Threshold-based operations |
|
|
279 | (1) |
|
11.7.3 Chaining operations |
|
|
280 | (1) |
|
11.7.4 Image data type, value range, and display |
|
|
281 | (1) |
|
|
282 | (6) |
|
11.8.1 The mean filtering operation |
|
|
283 | (1) |
|
11.8.2 The actual filter used |
|
|
284 | (1) |
|
11.8.3 Applying a filter in MATLAB |
|
|
285 | (2) |
|
11.8.4 Filtering and convolution |
|
|
287 | (1) |
|
|
288 | (1) |
|
|
288 | (1) |
|
|
289 | (6) |
|
Chapter 12 Graphical user interfaces |
|
|
295 | (28) |
|
|
295 | (1) |
|
12.2 Building a graphical user interface in MATLAB |
|
|
295 | (19) |
|
12.2.1 Building a GUI with the MATLAB App Designer tool |
|
|
296 | (4) |
|
12.2.2 Controlling components: events and callback functions |
|
|
300 | (7) |
|
12.2.3 Maintaining state: avoiding duplicated code |
|
|
307 | (5) |
|
12.2.4 Keeping track of a property when maintaining state |
|
|
312 | (2) |
|
12.3 Building an app: recap |
|
|
314 | (1) |
|
12.4 An app for image processing |
|
|
315 | (1) |
|
|
316 | (1) |
|
|
317 | (1) |
|
|
317 | (6) |
|
|
323 | (20) |
|
|
323 | (1) |
|
13.2 Descriptive statistics |
|
|
324 | (6) |
|
|
324 | (1) |
|
|
325 | (5) |
|
13.3 Inferential statistics |
|
|
330 | (7) |
|
13.3.1 Testing the distributions of data samples |
|
|
330 | (2) |
|
13.3.2 Comparing data samples |
|
|
332 | (5) |
|
|
337 | (1) |
|
|
338 | (1) |
|
|
339 | (4) |
|
Chapter 14 Machine learning |
|
|
343 | (30) |
|
|
343 | (1) |
|
14.2 Artificial intelligence, machine learning, and deep learning |
|
|
344 | (1) |
|
14.3 Types of machine learning |
|
|
345 | (1) |
|
14.4 Evaluating machine learning models |
|
|
345 | (2) |
|
14.5 Overfitting and underfitting |
|
|
347 | (1) |
|
14.6 Unsupervised learning |
|
|
348 | (7) |
|
|
348 | (4) |
|
14.6.2 Dimensionality reduction |
|
|
352 | (3) |
|
|
355 | (8) |
|
|
356 | (4) |
|
|
360 | (3) |
|
|
363 | (4) |
|
|
367 | (2) |
|
|
369 | (1) |
|
|
369 | (4) |
|
Chapter 15 Engineering mathematics |
|
|
373 | (54) |
|
|
373 | (1) |
|
|
373 | (5) |
|
|
378 | (8) |
|
15.3.1 Time-varying signals |
|
|
385 | (1) |
|
|
386 | (14) |
|
|
386 | (2) |
|
|
388 | (12) |
|
|
400 | (18) |
|
|
400 | (11) |
|
|
411 | (6) |
|
|
417 | (1) |
|
15.6 Differential equations |
|
|
418 | (4) |
|
15.7 Summary and further resources |
|
|
422 | (1) |
|
|
422 | (5) |
References |
|
427 | (2) |
Index |
|
429 | |