Category Archives: Optimizing your code

Everything you need to know to make your code runs faster

Code is poetry

Today, I want to give you some insight on how to make clean Matlab code that everyone can understand. This is a rather subjective subject but as a general guideline, I think you should think about the following: Programming languages … Continue reading

Posted in Beginners, Optimizing your code | 4 Comments

Columns and Rows are not the same

I am going to talk about arrays today..I show that Columns and Rows are not the same. I end on a few advanced optimization you can do with this. Continue reading

Posted in Intermediate, Optimizing your code | 9 Comments

On fractal graphics

I was recently browsing, just out of curiosity, an e-book by one of Matlab founder, Cleve Moller called “Experimenting with Matlab“. I recommend it to all new and experienced users of Matlab. This is quite an interesting reading to get started. On … Continue reading

Posted in Intermediate, Optimizing your code | 12 Comments

Some places, some rules

In my last post, I talked about using In place computation to limit memory usage of your calculation. I actually did not had the time to mention some important rules and limitations on this mechanism. You would be surprised but … Continue reading

Posted in Advanced, Optimizing your code | 16 Comments

What happen at my place, stays at my place

I recently talked about the Copy on write mechanism. It ensures that, when you copy a variable, memory is handled in an optimal way. I underlined that when you use subfunction, this can be quite useful as you in effect … Continue reading

Posted in Advanced, Optimizing your code | 1 Comment

Inline your lines

In essence, writing a Matlab program is aligning a succession of command that you send to the Matlab interpreter. Indeed, Matlab provides you with a large library of functions that you can use. The job of Mathworks is to create … Continue reading

Posted in Advanced, Beginners, Optimizing your code | 1 Comment

Look for the loop

A very well known piece of knowledge is that Matlab is bad at for loop. But you might ask: why? Matlab is an interpreted language. This means that it will take time to read each line, more than it would … Continue reading

Posted in Beginners, Optimizing your code | 5 Comments

What’s the difference between AND and AND AND?

I guess most of you know what & means. This is the AND operator. It does something simple. If you have two variable x and y and you ask : Then a will be equal to 1 only if both … Continue reading

Posted in Intermediate, Optimizing your code | Leave a comment

Choose your variables wisely…

I am stuck home with a big fever so I hope this post is going to make sense. We’ll see! I named it against a miracle remedy that I would love to have under my hand. One of the fundamental … Continue reading

Posted in Beginners, Optimizing your code | 5 Comments

Copy on Write in subfunctions

In my last post on Copy on Write, I didn’t talk at all about one very important consequence of the Copy on Write mechanisms. Usually, when someone is taught about subfunction, a big emphasis is made on carefully considering memory … Continue reading

Posted in Advanced, Optimizing your code | Leave a comment