How to optimize MATLAB loops?

Posted by striglia on Stack Overflow See other posts from Stack Overflow or by striglia
Published on 2010-03-01T18:47:11Z Indexed on 2010/04/04 15:53 UTC
Read the original article Hit count: 328

Filed under:
|
|

I have been working lately on a number of iterative algorithms in MATLAB, and been getting hit hard by MATLAB's performance (or lack thereof) when it comes to loops. I'm aware of the benefit of vectorizing code when possible, but are there any tools for optimization when you need the loop for your algorithm?

I am aware of the MEX-file option to write small subroutines in C/C++, although given my algorithms, this can be a very painful option given the data structures required. I mainly use MATLAB for the simplicity and speed of prototyping, so a syntactically complex, statically typed language is not ideal for my situation.

Are there any other suggestions? Even other languages (python?) which have relatively painless matrix tools are an option.

© Stack Overflow or respective owner

Related posts about matlab

Related posts about optimization