Getting Started |
Vectorization
One way to make your MATLAB programs run faster is to vectorize the algorithms you use in constructing the programs. Where other programming languages might use for
loops or DO
loops, MATLAB can use vector or matrix operations. A simple example involves creating a table of logarithms.
A vectorized version of the same code is
For more complicated code, vectorization options are not always so obvious.
For More Information See Maximizing MATLAB Performance for other techniques that you can use. |
Function Functions | Preallocation |
© 1994-2005 The MathWorks, Inc.