User`s guide

Why Compile M-Files?
1-15
Cases When Performance Does Not Improve. Compilation is not like ly to speed up
M-file functions that:
Are heavily vectorized
Spend most of their time in MATLAB’s built-in indexing, math, or graphics
functions
Cases When Performance Does Improve. Compilation is most likely to speed up
M-file functions that contain loops.