Cleaner Code in MATLAB Part 1
Uploader Comments (MatlabDoug)
All Comments (7)
-
I´m sorry, but stating that "people are rarely concerned with speed" sounds a little bold to me.
Considering MATLAB is among the most popular softwares for research/simulation, and given its capabilities, speed happens to be an issue in more than a handful of cases.
Of course it is a matter of how you use the tool and with what purpose.
However, it is clear to me that solving simple problems, isnt exactly MATLAB´s purpose.
-
good info. please keep them coming. I just got matlab and would like to learn more.
-
Thanks very much, MD. This short tutorials go a very long way in helping others out. I wish you the best.
-
All these videos were made with Camtasia.
-
Good hints, Doug. I would like to have more on cleaning and optimizing Matlab codes.
Although the modified code sure is more readable, it is not as efficient as the original one, from a processing perspective.
Using comentarys can also make the code more readable and yet keep it faster.
favoreto 3 years ago
There is a trade-off between speed and clarity. Rarely are people so concerned with speed that the speed matters. When it does, you can go back and optimize. This code runs 'instantly' anyways. I do not care if it runs in 0.01 or 0.02 seconds. I do care if I can understand it three days later when I am rereading it!
Doug
MatlabDoug 3 years ago