Miscellaneous MATLAB scripts