Matrices should be listed in the usual format. Entries should be separated by the space character. Multiple spaces are OK. Lines are separated by newline characters. The size of the matrix is determined by the length of the first line, so it is important that the first line should be the right length. Other lines don't matter (though it will look better if all lines are the right length).
Separate matrices in the file do not need to be separated by newlines, but doing so will improve readability of the file.
The following files contain matrices:
For the last two, the first line can be used to indicate the number of matrices in the file (and also whether any matrix should be used as a mask). The format of the first line is
number [mask] number
where the numbers are the number of matrices before and after the mask matrix.