Suppose you have a matrix M which has 3 rows and 4 columns. When you enter WRITE\MATRIX file M the rows of the matrix are written into records of the file. There will be 3 records, each containing 4 numbers. But, if you then entered READ\MATRIX file M 3 4 the input matrix would be scrambled, because READ puts the first record into the first column, 2nd record into 2nd column, etc. Thus, the matrix is transposed, or flipped. To read it in properly, you would have to enter READ\MATRIX file M 4 3 and then take the transpose, M = <-M. So, there is a new qualifier, \-FLIPPED, which has the syntax: READ\MATRIX\-FLIPPED file matrix ncolumns nrows Note that the default, without the \-FLIPPED qualifier, the syntax remains: READ\MATRIX file matrix nrows ncolumns
A scalar appended to the file name, file\n, specifies the starting record. The first n-1 records will be skipped.
Syntax: READ\MATRIX file{\n} matrix nr { nc } READ\MATRIX\-FLIPPED file{\n} matrix nc { nr } READ\MATRIX\FORMAT file{\n} (frmt) matrix nr { nc } READ\MATRIX\FORMAT\-FLIPPED file{\n} (frmt) matrix nc { nr } Qualifiers: \FLIPPED, \FORMAT, \CONTINUE, \CLOSE, \MESSAGES Defaults: \FLIPPED, \-FORMAT, \-CONTINUE, \-CLOSE, \MESSAGES By default, or if the \ASCII qualifier is used, the file is assumed to be an ASCII file and is read by records. A scalar appended to the file name as a qualifier, file\n, specifies the starting record. The file will be read from the n_th record to the end of file.
Additional Information on:
Syntax: READ\MATRIX\UNFORMATTED file{\n} (frmt) matrix nr { nc } READ\MATRIX\UNFORMATTED\-FLIPPED file{\n} (frmt) matrix nc { nr } Qualifiers: \FLIPPED, \CONTINUE, \CLOSE, \MESSAGES Defaults: \FLIPPED, \-CONTINUE, \-CLOSE, \MESSAGES If the \UNFORMATTED qualifier is used, the file is assumed to be an unformatted binary file. The 2 methods of reading data from unformatted binary files, by record or stream, are indicated by the prescription, (frmt), paramter, which is required with the \UNFORMATTED qualifier. A scalar appended to the file name as a qualifier, file\n, specifies the starting record.
Additional Information on: