Reading/Writing to CSV in Matlab

When doing data analysis, many times your input will come in a .csv file, and you'll also want output in a .csv file.  Unfortunately, matlab's built-in csvread/csvwrite functions are exceptionally frustrating to use for anything than pure numeric input/output.  Luckily, writing your own code to read /csv files (especially with some knowledge of your desired input/output) is pretty easy. Reading...Read More

Reflections on Grad School: Tools and Tricks I wish I knew all along

I've done it! I've gotten my Ph.D.!  Here's a few things I wish I had done from the very beginning. Enjoy Yourself. You're going to take 4-8 years investing in yourself. This is time you've set aside to educate yourself about a subject you're hopefully passionate about.  Along the way, you'll learn a tonne about a multitude of subjects! Besides...Read More

28 Best apps for Mac

I recently did a reset on my Mac, and had to re-download all of my favorite Apps.  This was actually a pretty painless process, but I thought a useful post might be all the top apps for Mac I think are worth having on my machine. These arn't really in a particular order: Dropbox Google Chrome MATLAB MacTeX Latexian Mendeley...Read More

Vectorized Binning in Matlab

In fluids modeling, a really easy way to build an model of a scalar (e.g., a polutant or chemical) that is transported by a flowfield is using a particle tracking model. Here, you have millions of finite particles, with x and y locations (and possibly mass).  building code to advect the particles by the flow-field and diffuse them based on...Read More

Monitoring Progress in Matlab

There are a lot of pre-made codes out there to make progress bars for your code.  A lot of these work fine, but some will slow down your code.  The last thing you want is a progress bar that hampers progress. I like the built-in waitbar function in matlab.  It's pretty easy to use following the help dialog, with the caveat that it...Read More

Matlab Tip: Change the color-scheme to be easier on your eyes

Hey Matlab users, here's a quick tip that I hope is helpful.  If you stare at MATLAB for long hours, espically late at night, then changing your color scheme is a quick an easy way to reduce eye strain (and maybe help you sleep better). Our eyes never evolved to stare at a bright white light all day, and research...Read More

Rounding to Order of Magnitude in Matlab

Knowing what order of magnitude a number is can be really helpful when performing analysis.  I find this especially useful when setting my color-scale using caxis. To find the order of magnitude of a number, denoted as O(10n) of some number A in matlab, use: n=floor( log10(A)); [caption id="attachment_1179" align="alignright" width="300"] Example: Say I want to plot this constrained to some integer value of 10^n....Read More

Tool of the Week: Boosting Performance in Mac OSX

Most of these performance improvements are super minor, but when my system is pegged out with a hefty image processing job or particle tracking model: every little bit helps.  These are especially useful if Matlab is running slow! Also, apparently saving 5% of CPU power can increase battery life by 20-30 mins.  Here are 10 ways to boost your system performance! [caption id="attachment_1068" align="alignleft" width="300"] In...Read More

Understanding Heart Rate

So I just got a Garmin, mostly to record long rides on strava without killing my phone battery. But I'm also a bit interested in the Heart Rate data craze.  So far, everything i've found on heart rate training seems anecdotal at best: "Subtract your age from 220..."  That's about where I stop reading.  It seems like this formula is a good guess,...Read More

MATLAB Tip: Logarithmic color-scales for contour and image plots

[caption id="attachment_761" align="alignright" width="392"] Logarithmic Color-bar for Contour Plot[/caption] A lot of my data ranges orders of magnitude, and can be very hard to depict using standard MATLAB functions like imagesc, contourf, contour, etc.  A quick google search on how to make logarithmic contour plots and logarithmic color-bars yielded some unhelpful results, so I thought I'd give a quick post here. 1) Define Your Contours Define where you'd like...Read More