Category Archives: Optimizing your code

Everything you need to know to make your code runs faster

Using pointers in Matlab

In this post, I first introduce you to the world of pointer and then shows you how to use them in Matlab for real. Continue reading

Posted in Advanced, Optimizing your code | 13 Comments

Mathworks has listened to our TIFF prays!

I just want to leave a short note : Mathworks just released a new version of their Tiff libraries to improve performance on all Matlab since 2009b with Tiffs! Continue reading

Posted in Annoyances, Optimizing your code | 1 Comment

The art of vectorizing – Part 3

Following the last post on using repmat to avoid unnecessary for loops, I introduce bsxfun which is a faster alternative to repmat. Continue reading

Posted in Intermediate, Optimizing your code | 6 Comments

The art of vectorizing – Part 2

In a previous post, I introduced you how to vectorize your code. Here I show how to use repmat to process series of elements all at once. Continue reading

Posted in Intermediate, Optimizing your code | 7 Comments

The art of vectorizing – Part 1

Vectorizing is the art of transforming a calculation done element by element into an operation on vectors. Here I start a serie of posts on how to vectorize your code. Continue reading

Posted in Beginners, Optimizing your code | 1 Comment

Preallocation is not an option

As any activity, programming does require that you follow some rules of good practice. In this post, I introduce you to the joy of memory preallocation. Continue reading

Posted in Beginners, Optimizing your code | Leave a comment

Matlab is no longer slow at for loops

Here, I discuss the most widespread piece of knowledge on Matlab : its inherent slowness with for loop. I demonstrate that it is no longer the case, explain why, and discuss some of the consequences of this fact. Continue reading

Posted in Intermediate, Optimizing your code | 12 Comments