First version of mex_WriteMatrix
Third version of mex_WriteMatrix. Fast and can specify format and delimiter