Writing into data matrix file