export mat in .mat
merged with writeMat