This is part of a matlab intro course for biologists. I have my data points (for a single particle!) in a matrix with 4 columns (time, x, y, z) and a few thousand rows. What
Note that there's a MATLAB class available to do MSD analysis: MSD analyzer, including extensive documentation and tutorials.
Basic usage:
ma = msdanalyzer(2, SPACE_UNITS, TIME_UNITS); ma = ma.addAll(tracks); ma = ma.computeMSD;