MATLAB is full of all kinds of shortcuts and neat ways of doing things, but it can take a long time to discover them on your own. And, sometimes you discover something but don’t realize at the time that you need it or how it will fit into your workflow or project. Wouldn’t it be nice to have a list of these things to look at and refer to periodically?!

Over the years, I’ve compiled a list of little things, pieces of advice, that I’ve passed on to my students. I’ll be following up on this post with a series of posts in which I explain a little bit about each of the following tips:

  1. Comment, comment, comment!
  2. Minimize # of variables in workspace
  3. Avoid for loops, if possible
  4. Use a “flag” variable for filtering
  5. Don’t use punctuation or spaces in variable names
  6. Code “folding” - when you just don’t want to see your code!
  7. Run code in sections - sometimes you just want to run part of your script
  8. Cell arrays - arrays of anything!
  9. Structures - it’s all about the dot
  10. Tables/timetables - data references with names

A lot of these are just variable types that you may not have come across yet, especially if you’ve recently started using MATLAB. Others are just simple but very useful features that may have been hiding in plain sight!