Tuesday, March 06, 2007

 

Matlab optimization

Numerical issues are really severe for my current simulation with MATLAB. The computing speed is killing me if I use smaller time step for the purpose of stability, say, I have to wait for about 30 days to get sufficient results! That is not acceptable. So the past couple days, instead of switching to another language (this is also a time-consuming task), I spent lots of time to optimize my MATLAB code, and , fortunately, I did learn something and improved my code speed quite a lot. Now the speed is more than 10 times faster than before, which really surprised me. So I believe these experience are worthy of sharing:
Much more than that, here is one great book writen by Peter Acklam:MATLAB array manipulation tips and tricks. This is something you can not get from regular commercial MATLAB books.

So if you have spent one week for writing your code, I strongly suggest you to spend one more week to optimize it . I bet you will get what you paid for.

This page is powered by Blogger. Isn't yours?