Cleanup of matlab code, update of matrix file input format