Introduction |
|
1 | (1) |
About This Book |
|
1 | (1) |
Foolish Assumptions |
|
2 | (1) |
Icons Used in This Book |
|
3 | (1) |
Beyond the Book |
|
4 | (1) |
Where to Go from Here |
|
4 | (3) |
|
PART 1 GETTING STARTED WITH MATLAB |
|
|
7 | (74) |
|
Chapter 1 Introducing Matlab And Its Many Uses |
|
|
9 | (12) |
|
Putting MATLAB in Its Place |
|
|
10 | (7) |
|
Understanding how MATLAB relates to a Turing machine |
|
|
10 | (3) |
|
Using MATLAB as more than a calculator |
|
|
13 | (1) |
|
Determining why you need MATLAB |
|
|
14 | (3) |
|
Discovering Who Uses MATLAB for Real-World Tasks |
|
|
17 | (1) |
|
Knowing How to Get the Most from MATLAB |
|
|
18 | (2) |
|
Getting the basic computer skills |
|
|
18 | (1) |
|
Defining the math requirements |
|
|
19 | (1) |
|
Applying what you know about other procedural languages |
|
|
19 | (1) |
|
Understanding how this book will help you |
|
|
20 | (1) |
|
Getting Over the Learning Curve |
|
|
20 | (1) |
|
Chapter 2 Starting Your Copy Of Matlab |
|
|
21 | (20) |
|
|
22 | (3) |
|
Discovering which platforms MATLAB supports |
|
|
22 | (1) |
|
Getting your copy of MATLAB |
|
|
23 | (1) |
|
Performing the installation |
|
|
23 | (1) |
|
|
24 | (1) |
|
Meeting the MATLAB Interface |
|
|
25 | (16) |
|
Starting MATLAB for the first time |
|
|
25 | (2) |
|
Considering the default Toolstrip tabs |
|
|
27 | (2) |
|
Working with the Quick Access toolbar (QAT) |
|
|
29 | (1) |
|
Employing the Command Window |
|
|
30 | (1) |
|
Getting additional help with MATLAB |
|
|
31 | (1) |
|
Using the Current Folder toolbar |
|
|
32 | (1) |
|
Viewing the Current Folder window |
|
|
32 | (6) |
|
Changing the MATLAB layout |
|
|
38 | (3) |
|
Chapter 3 Interacting With Matlab |
|
|
41 | (20) |
|
Using MATLAB as a Calculator |
|
|
42 | (6) |
|
Entering information at the prompt |
|
|
42 | (2) |
|
|
44 | (1) |
|
Copying and pasting formulas |
|
|
44 | (2) |
|
Changing the Command Window formatting |
|
|
46 | (1) |
|
Suppressing Command Window output |
|
|
47 | (1) |
|
Understanding the MATLAB Math Syntax |
|
|
48 | (3) |
|
Adding, subtracting, multiplying, and dividing |
|
|
48 | (2) |
|
|
50 | (1) |
|
Organizing Your Storage Locker |
|
|
51 | (3) |
|
Using ans -- the default storage locker |
|
|
52 | (1) |
|
Creating your own storage lockers |
|
|
52 | (2) |
|
Operating MATLAB as More Than a Calculator |
|
|
54 | (3) |
|
|
54 | (1) |
|
Using the built-in functions |
|
|
54 | (2) |
|
Accessing the function browser |
|
|
56 | (1) |
|
|
57 | (4) |
|
Understanding the MATLAB error messages |
|
|
58 | (1) |
|
Stopping MATLAB when it hangs |
|
|
58 | (3) |
|
Chapter 4 Starting, Storing, And Saving Matlab Files |
|
|
61 | (20) |
|
Examining MATLAB's File Structure |
|
|
62 | (12) |
|
Understanding the MATLAB files and what they do |
|
|
63 | (2) |
|
Exploring folders with the GUI |
|
|
65 | (4) |
|
Exploring folders with commands |
|
|
69 | (3) |
|
Working with files in MATLAB |
|
|
72 | (2) |
|
Accessing and Sharing MATLAB Files |
|
|
74 | (4) |
|
|
74 | (1) |
|
|
75 | (1) |
|
|
76 | (2) |
|
|
78 | (3) |
|
Saving variables with the GUI |
|
|
78 | (1) |
|
Saving variables using commands |
|
|
78 | (1) |
|
Saving commands with the GUI |
|
|
79 | (1) |
|
Saving commands using commands |
|
|
79 | (1) |
|
|
80 | (1) |
|
PART 2 MANIPULATING AND PLOTTING DATA IN MATLAB |
|
|
81 | (82) |
|
Chapter 5 Embracing Vectors, Matrices, And Higher Dimensions |
|
|
83 | (38) |
|
Working with Vectors and Matrices |
|
|
84 | (8) |
|
Understanding MATLAB's perspective of linear algebra |
|
|
84 | (2) |
|
|
86 | (6) |
|
|
92 | (2) |
|
Understanding the Many Ways to Multiply and Divide |
|
|
94 | (11) |
|
Performing scalar multiplication and division |
|
|
94 | (1) |
|
Employing matrix multiplication |
|
|
95 | (3) |
|
|
98 | (1) |
|
Effecting matrix division |
|
|
98 | (3) |
|
Creating powers of matrices |
|
|
101 | (1) |
|
|
102 | (2) |
|
|
104 | (1) |
|
Working with Higher Dimensions |
|
|
105 | (12) |
|
Creating a multidimensional matrix |
|
|
105 | (3) |
|
Accessing a multidimensional matrix |
|
|
108 | (1) |
|
Replacing individual elements |
|
|
109 | (1) |
|
Replacing a range of elements |
|
|
110 | (2) |
|
Modifying the matrix size |
|
|
112 | (1) |
|
Using cell arrays and structures |
|
|
113 | (4) |
|
|
117 | (4) |
|
Chapter 6 Understanding Plotting Basics |
|
|
121 | (18) |
|
|
121 | (7) |
|
Understanding what you can do with plots |
|
|
122 | (1) |
|
Comparing MATLAB plots to spreadsheet graphs |
|
|
122 | (1) |
|
Creating a plot using commands |
|
|
123 | (2) |
|
Creating a plot using the Workspace window |
|
|
125 | (1) |
|
Creating a plot using the Plots tab options |
|
|
126 | (2) |
|
|
128 | (2) |
|
Working with line color, markers, and line style |
|
|
128 | (1) |
|
Creating multiple plots in a single command |
|
|
129 | (1) |
|
|
130 | (7) |
|
|
130 | (2) |
|
|
132 | (2) |
|
|
134 | (1) |
|
|
134 | (3) |
|
Plotting with 2D Information |
|
|
137 | (2) |
|
Chapter 7 Using Advanced Plotting Features |
|
|
139 | (24) |
|
Plotting with 3D Information |
|
|
140 | (7) |
|
Using the bar() function to obtain a flat 3D plot |
|
|
140 | (4) |
|
Using bar3() to obtain a dimensional 3D plot |
|
|
144 | (2) |
|
|
146 | (1) |
|
|
147 | (8) |
|
|
147 | (1) |
|
|
148 | (2) |
|
|
150 | (1) |
|
|
151 | (2) |
|
|
153 | (1) |
|
|
154 | (1) |
|
|
155 | (8) |
|
Creating axes dates using datetick() |
|
|
155 | (2) |
|
Creating plots with colorbar() |
|
|
157 | (2) |
|
|
159 | (2) |
|
Interacting with pbaspect |
|
|
161 | (2) |
|
PART 3 STREAMLINING MATLAB |
|
|
163 | (152) |
|
Chapter 8 Automating Your Work |
|
|
165 | (20) |
|
Understanding What Scripts Do |
|
|
166 | (2) |
|
Creating less work for yourself |
|
|
166 | (1) |
|
Defining when to use a script |
|
|
167 | (1) |
|
|
168 | (11) |
|
Writing your first script |
|
|
168 | (2) |
|
Using commands for user input |
|
|
170 | (1) |
|
Copying and pasting into a script |
|
|
171 | (1) |
|
Converting the Command History into a script |
|
|
172 | (1) |
|
|
172 | (2) |
|
Adding comments to your script |
|
|
174 | (5) |
|
|
179 | (1) |
|
|
179 | (1) |
|
Improving Script Performance |
|
|
180 | (1) |
|
Analyzing Scripts for Errors |
|
|
181 | (1) |
|
Using the MATLAB Profiler to Improve Performance |
|
|
182 | (3) |
|
Chapter 9 Expanding Matlab's Power With Functions |
|
|
185 | (22) |
|
Working with Built-in Functions |
|
|
186 | (5) |
|
Learning about built-in functions |
|
|
186 | (5) |
|
Sending data in and getting data out |
|
|
191 | (1) |
|
|
191 | (13) |
|
Understanding script and function differences |
|
|
192 | (1) |
|
Understanding built-in function and custom function differences |
|
|
193 | (1) |
|
Writing your first function |
|
|
193 | (2) |
|
|
195 | (1) |
|
|
196 | (2) |
|
|
198 | (1) |
|
Creating and using global variables |
|
|
199 | (3) |
|
|
202 | (1) |
|
|
203 | (1) |
|
Using Other Types of Functions |
|
|
204 | (3) |
|
|
204 | (1) |
|
|
205 | (2) |
|
Chapter 10 Adding Structure To Your Scripts |
|
|
207 | (22) |
|
|
208 | (7) |
|
|
208 | (4) |
|
Using the switch statement |
|
|
212 | (2) |
|
Understanding the switch difference |
|
|
214 | (1) |
|
Deciding between if and switch |
|
|
214 | (1) |
|
Creating Recursive Functions |
|
|
215 | (4) |
|
Performing Tasks Repetitively |
|
|
219 | (6) |
|
|
219 | (1) |
|
Using the while statement |
|
|
220 | (1) |
|
Starting a new loop iteration using continue |
|
|
221 | (1) |
|
Ending processing using break |
|
|
222 | (1) |
|
Ending processing using return |
|
|
223 | (2) |
|
Determining which loop to use |
|
|
225 | (1) |
|
|
225 | (4) |
|
Chapter 11 Working With Live Scripts |
|
|
229 | (16) |
|
Comparing a Live Script to a Regular Script |
|
|
230 | (1) |
|
Working with the Live Editor |
|
|
231 | (10) |
|
|
232 | (1) |
|
Working with the Output pane |
|
|
232 | (3) |
|
|
235 | (1) |
|
Using plots within the coded area |
|
|
236 | (1) |
|
|
237 | (1) |
|
|
238 | (3) |
|
Running Live Script Sections |
|
|
241 | (1) |
|
|
242 | (3) |
|
Chapter 12 Working With Live Functions |
|
|
245 | (18) |
|
Comparing a Live Function to a Regular Function |
|
|
246 | (1) |
|
Understanding Live Function Flexibility Differences |
|
|
247 | (8) |
|
|
247 | (1) |
|
|
248 | (1) |
|
Refactoring a Live Function |
|
|
249 | (4) |
|
Using the specialized coding buttons |
|
|
253 | (1) |
|
Going to a specific function |
|
|
254 | (1) |
|
Converting a Function to a Live Function |
|
|
255 | (1) |
|
Sharing Live Functions and Live Scripts |
|
|
256 | (3) |
|
Using an interactive document |
|
|
256 | (1) |
|
Employing a full screen presentation |
|
|
257 | (1) |
|
|
257 | (1) |
|
Creating a static document |
|
|
257 | (2) |
|
Performing Comparisons and Merges |
|
|
259 | (4) |
|
Comparing Live Functions and Live Scripts |
|
|
259 | (1) |
|
Merging Live Functions and Live Scripts |
|
|
260 | (3) |
|
Chapter 13 Designing And Using Classes |
|
|
263 | (18) |
|
A Brief Overview of Object-Oriented Programming (OOP) |
|
|
264 | (4) |
|
|
264 | (1) |
|
Considering how properties define an object |
|
|
265 | (1) |
|
Using methods to interact with an object |
|
|
266 | (1) |
|
Listening to an object using events |
|
|
267 | (1) |
|
Understanding the need for privacy |
|
|
268 | (1) |
|
Understanding OOP in MATLAB |
|
|
268 | (4) |
|
Comparing MATLAB OOP to other languages |
|
|
269 | (1) |
|
Uses of classes and objects in MATLAB |
|
|
270 | (1) |
|
Performing tasks with objects in MATLAB |
|
|
271 | (1) |
|
Creating a Basic MATLAB Class |
|
|
272 | (9) |
|
|
272 | (3) |
|
|
275 | (3) |
|
|
278 | (3) |
|
Chapter 14 Creating Matlab Apps |
|
|
281 | (20) |
|
Working with the App Designer |
|
|
282 | (8) |
|
|
282 | (1) |
|
|
283 | (3) |
|
Starting the App Designer |
|
|
286 | (4) |
|
|
290 | (3) |
|
Understanding the various components |
|
|
290 | (2) |
|
Changing the component properties |
|
|
292 | (1) |
|
Making the Interface Functional |
|
|
293 | (4) |
|
|
294 | (1) |
|
Creating a callback function |
|
|
295 | (2) |
|
|
297 | (1) |
|
|
298 | (3) |
|
Chapter 15 Building Projects |
|
|
301 | (14) |
|
Considering the Need for Projects |
|
|
302 | (1) |
|
|
303 | (6) |
|
|
303 | (2) |
|
|
305 | (4) |
|
Understanding the Project Dependencies |
|
|
309 | (2) |
|
|
311 | (4) |
|
Checking project integrity |
|
|
311 | (1) |
|
Looking for potential updates |
|
|
311 | (4) |
|
PART 4 EMPLOYING ADVANCED MATLAB TECHNIQUES |
|
|
315 | (64) |
|
Chapter 16 Importing And Exporting Data |
|
|
317 | (18) |
|
|
318 | (10) |
|
Avoiding older import/export function calls |
|
|
319 | (1) |
|
|
319 | (6) |
|
Importing mixed strings and numbers |
|
|
325 | (2) |
|
Importing selected rows or columns |
|
|
327 | (1) |
|
|
328 | (4) |
|
|
328 | (3) |
|
Exporting scripts and functions |
|
|
331 | (1) |
|
|
332 | (3) |
|
|
332 | (1) |
|
|
333 | (2) |
|
Chapter 17 Printing And Publishing Your Work |
|
|
335 | (22) |
|
Using Commands to Format Text |
|
|
336 | (14) |
|
Modifying font appearance |
|
|
336 | (8) |
|
|
344 | (2) |
|
|
346 | (4) |
|
Publishing Your MATLAB Data |
|
|
350 | (5) |
|
Performing advanced script and function publishing tasks |
|
|
350 | (4) |
|
Saving your figures to disk |
|
|
354 | (1) |
|
|
355 | (2) |
|
Configuring the output page |
|
|
355 | (1) |
|
|
356 | (1) |
|
Chapter 18 Recovering From Mistakes |
|
|
357 | (22) |
|
Working with Error Messages |
|
|
358 | (8) |
|
Responding to error messages |
|
|
359 | (2) |
|
Understanding the MException class |
|
|
361 | (1) |
|
Creating error and warning messages |
|
|
362 | (3) |
|
Setting warning message modes |
|
|
365 | (1) |
|
Understanding Quick Alerts |
|
|
366 | (2) |
|
Relying on Common Fixes for MATLAB's Error Messages |
|
|
368 | (1) |
|
Making Your Own Error Messages |
|
|
369 | (6) |
|
Developing the custom error message |
|
|
370 | (4) |
|
Creating useful error messages |
|
|
374 | (1) |
|
Using Good Coding Practices |
|
|
375 | (4) |
|
PART 5 SPECIFIC MATLAB APPLICATIONS |
|
|
379 | (40) |
|
Chapter 19 Solving Equations And Finding Roots |
|
|
381 | (24) |
|
Working with the Symbolic Math Toolbox |
|
|
382 | (6) |
|
Obtaining your copy of the Symbolic Math Toolbox |
|
|
382 | (2) |
|
Installing the Symbolic Math Toolbox |
|
|
384 | (2) |
|
|
386 | (1) |
|
Typing a simple command in the Command Window |
|
|
387 | (1) |
|
Performing Algebraic Tasks |
|
|
388 | (7) |
|
Differentiating between numeric and symbolic algebra |
|
|
389 | (1) |
|
Solving quadratic equations |
|
|
390 | (2) |
|
Working with cubic and other nonlinear equations |
|
|
392 | (1) |
|
Understanding interpolation |
|
|
393 | (2) |
|
|
395 | (6) |
|
Understanding descriptive statistics |
|
|
395 | (3) |
|
Understanding robust statistics |
|
|
398 | (3) |
|
Employing the Symbolic Math Toolbox for plotting |
|
|
401 | (4) |
|
Chapter 20 Performing Analysis |
|
|
405 | (14) |
|
|
406 | (5) |
|
Working with determinants |
|
|
406 | (1) |
|
|
407 | (2) |
|
|
409 | (1) |
|
Understanding factorization |
|
|
409 | (2) |
|
|
411 | (4) |
|
Working with differential calculus |
|
|
411 | (2) |
|
|
413 | (1) |
|
Working with multivariate calculus |
|
|
413 | (2) |
|
Solving Differential Equations |
|
|
415 | (4) |
|
Using the numerical approach |
|
|
415 | (1) |
|
Using the symbolic approach |
|
|
416 | (3) |
|
|
419 | (18) |
|
Chapter 21 The Top Ten Uses Of Matlab |
|
|
421 | (8) |
|
Working with Linear Algebra |
|
|
422 | (1) |
|
Performing Numerical Analysis |
|
|
422 | (1) |
|
Designing a Neural Network Simulation |
|
|
423 | (1) |
|
Getting Involved in Science |
|
|
423 | (1) |
|
|
424 | (1) |
|
|
424 | (1) |
|
Creating Light Animations Using Arduino |
|
|
425 | (1) |
|
Employing Image Processing |
|
|
425 | (1) |
|
Controlling Industrial Equipment |
|
|
426 | (1) |
|
Performing Audio Compression Using Wavelets |
|
|
427 | (2) |
|
Chapter 22 Ten Ways To Make A Living Using Matlab |
|
|
429 | (8) |
|
Working with Green Technology |
|
|
430 | (1) |
|
Creating Speech Recognition Software |
|
|
430 | (1) |
|
Performing Antenna Analysis and Design |
|
|
431 | (1) |
|
Getting Disease under Control |
|
|
432 | (1) |
|
Becoming a Computer Chip Designer |
|
|
432 | (1) |
|
|
433 | (1) |
|
Keeping the Trucks Rolling |
|
|
433 | (1) |
|
Designing Equipment Used in the Field |
|
|
434 | (1) |
|
Reducing Risks Using Simulation |
|
|
434 | (1) |
|
Creating Security Solutions |
|
|
435 | (2) |
Appendix A Matlab Functions |
|
437 | (10) |
Appendix B Matlab's Plotting Routines |
|
447 | (6) |
Index |
|
453 | |