
243Implicit Parallelization (Vectorization and Indexing)
This surprising result depends on platform, release, and data-size. The same code on a
different platform produces timing results that are the same for both variants. This high-
lights once again the need to test performance on the target platform.
bsxfun’s automatic singleton expansion enables easy generation of an outer product (also
called cross-product or tensor product)
760
of two vectors, creating a matrix having dimen-
sions that are the respective lengths of the two vectors.
761
For example, to create an outer
product from the difference between two vectors (i.e., a matrix whose elements ...