Cleaner Code in MATLAB Part 1

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
7,036
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Dec 13, 2006

http://blogs.mathworks.com/videos First in a series of videos showing how to make code cleaner and more maintainable. This week describes the problem, shows the bad code, and improves the code by breaking a logical check into easier to understand steps.

Category:

Howto & Style

Tags:

License:

Standard YouTube License

  • likes, 1 dislikes

Link to this comment:

Share to:

Uploader Comments (MatlabDoug)

  • 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.

  • 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

see all

All Comments (7)

Sign In or Sign Up now to post a comment!
  • 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.

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more