Adding two implementations of PLY write function for MATLAB