
129Standard Performance-Tuning Techniques
Note that absence of this warning does not imply that a code segment is actually used.
For example, we are not warned about calling a function that does nothing useful.
MATLAB’s editor (Code Analyzer) cannot detect all forms of unnecessary computa-
tions. For example, a very common MATLAB pitfall is multiple unnecessary data trans-
pose. Quite often, the code will run exactly the same when the data is not transposed.
Transposing data is very efcient for small data arrays, but can become a performance hog
when repeated within a loop, or when applied to large data:
data = rand(10000); % 10K x 10K = ~800MB ...