
223
5
Implicit Parallelization (Vectorization and Indexing)
5.1 Introduction to MATLAB
®
Vectorization
5.1.1 So What Exactly Is MATLAB Vectorization?
MATLAB contains very powerful internal mechanisms that enable code to run much
faster by automatically parallelizing arithmetic and logical operations on data. This is
called implicit (automatic) parallelization,
706
since we do not need to explicitly tell MATLAB
to parallelize the operations; MATLAB does it auto-magically when we pass vectorized
(nonscalar) data to most built-in functions, using multithreading.*
Implicit parallelization relies on the fact that many loops have iterations that are i