WORKING update 7_1_13

This is the final version of the MATLAB files; it just needs polishing
and commenting.