Profile Multiple Statements in Command Window .............
29-10
Profile an App ........................................
29-11
Determine Code Coverage Using the Profiler .................
29-12
Techniques to Improve Performance ........................
29-14
Environment ........................................
29-14
Code Structure .......................................
29-14
Programming Practices for Performance ....................
29-14
Tips on Specific MATLAB Functions .......................
29-15
Preallocation ...........................................
29-16
Preallocating a Nondouble Matrix ........................
29-16
Vectorization ...........................................
29-18
Using Vectorization ...................................
29-18
Array Operations .....................................
29-19
Logical Array Operations ...............................
29-20
Matrix Operations ....................................
29-21
Ordering, Setting, and Counting Operations .................
29-22
Functions Commonly Used in Vectorization .................
29-23
Background Processing
30
Asynchronous Functions ...................................
30-2
Asynchronous Code ....................................
30-2
Background Workers ...................................
30-4
Run MATLAB Functions in Thread-Based Environment .........
30-5
Run Functions in the Background ..........................
30-5
Run Functions on a Thread Pool ...........................
30-5
Automatically Scale Up ..................................
30-5
Check Thread Supported Functions ........................
30-5
Use the Background to Make Your Apps More Responsive .......
30-7
Open App Designer App .................................
30-7
Add a Future Array to the Properties .......................
30-7
Create y-axis Data in the Background .......................
30-8
Automatically Update Plot After Data Is Calculated in the Background
.................................................
30-8
Make Your App More Responsive by Canceling the Future Array ..
30-9
Responsive App That Calculates and Plots Simple Curves .......
30-10
Run Functions in Background .............................
30-11
Update Wait Bar While Functions Run in the Background ......
30-12
xxiv
Contents
29-10
Profile an App ........................................
29-11
Determine Code Coverage Using the Profiler .................
29-12
Techniques to Improve Performance ........................
29-14
Environment ........................................
29-14
Code Structure .......................................
29-14
Programming Practices for Performance ....................
29-14
Tips on Specific MATLAB Functions .......................
29-15
Preallocation ...........................................
29-16
Preallocating a Nondouble Matrix ........................
29-16
Vectorization ...........................................
29-18
Using Vectorization ...................................
29-18
Array Operations .....................................
29-19
Logical Array Operations ...............................
29-20
Matrix Operations ....................................
29-21
Ordering, Setting, and Counting Operations .................
29-22
Functions Commonly Used in Vectorization .................
29-23
Background Processing
30
Asynchronous Functions ...................................
30-2
Asynchronous Code ....................................
30-2
Background Workers ...................................
30-4
Run MATLAB Functions in Thread-Based Environment .........
30-5
Run Functions in the Background ..........................
30-5
Run Functions on a Thread Pool ...........................
30-5
Automatically Scale Up ..................................
30-5
Check Thread Supported Functions ........................
30-5
Use the Background to Make Your Apps More Responsive .......
30-7
Open App Designer App .................................
30-7
Add a Future Array to the Properties .......................
30-7
Create y-axis Data in the Background .......................
30-8
Automatically Update Plot After Data Is Calculated in the Background
.................................................
30-8
Make Your App More Responsive by Canceling the Future Array ..
30-9
Responsive App That Calculates and Plots Simple Curves .......
30-10
Run Functions in Background .............................
30-11
Update Wait Bar While Functions Run in the Background ......
30-12
xxiv
Contents
