Category Archives: Optimizing your code

Everything you need to know to make your code runs faster

Auto-contrast: an optimization example where Matlab beats Matlab

For this post, we are glad to have Thierry as a guest blogger. He talks about an optimisation example he recently encountered that is a good indirect example of ‘inlining‘. As my first post here, I will first describe a standard … Continue reading

Posted in Optimizing your code | Tagged , , | Leave a comment

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 | 19 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 | 10 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 | 9 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 | 15 Comments

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 | 1 Comment