165MATLAB
®
-Specic Techniques
It should be noted that while the numerical complexity may decrease, in some cases this
may come at the expense of increased memory usage. This is not always the case. In fact,
in our example above, the temporary matrix created by B*C is 200×400 (or 625 KB), which
is signicantly smaller than the temporary matrix for A*B (300×10000, or 23 MB). This may
be the reason that the speedup we received (~2.3) was slightly faster than the theoretical
expected value (2.2). As the matrices size increases, so too does the impact of the memory
effect (also see Chapter 9).
The effect of multiplication order increases when the multiplicands have signicantly
different dimension sizes. This is the case when matrices are multip ...