I have noticed that the first time I run a script, it takes considerably more time than the second and third time1. The \"warm-up\" is mentioned in this question
Matlab is interpreted. If you don't warm up the code, you will be losing a lot of time due to interpretation instead of the actual algorithm. This can skew results of timings significantly.
Running the code at least once will enable Matlab to actually compile appropriate code segments.