Extracts size and storage information out of a Matrix Market file
[rows,cols,entries,rep,field,symm,comments] = mminfo(filename)
a 1-by-1 matrix of strings, path of the Matrix Market file, or logical unit associated to that file.
a 1-by-1 real matrix, number of matrix rows.
a 1-by-1 real matrix, number of matrix columns.
a 1-by-1 real matrix, number of entries stored in the file (see below).
a 1-by-1 matrix of strings, with values "coordinate" or "array".
a 1-by-1 matrix of strings, with values "real", "complex" or "pattern".
a 1-by-1 matrix of strings, with values "general", "symmetric", "skew-symmetric", "hermitian".
a 1-by-n matrix of strings, contains the comments present in the file header.
mminfo
Extracts size and storage information out of a Matrix Market file.
In the case of coordinate matrices, entries refers to the number of coordinate entries stored in the file. The number of non-zero entries in the final matrix cannot be determined until the data is read (and symmetrized, if necessary). In the case of array matrices, entries is the product rows*cols, regardless of whether symmetry was used to store the matrix efficiently.
If filename
is a file path ,
mminfo(filename)
opens the file, reads the information
and then closes the file.
If filename
is a logical unit (see mopen
) ,
mminfo(filename)
reads the information and and let the
file pointer positionned at the beginning of the data in the file
without left hand side arguments mminfo(filename)
displays the file information.
In the following example, we extract the information from a 4-by-4 complex hermitian matrix.
filename = fullfile(mmgetpath(),"tests","unit_tests","A.mtx"); // Print in the console mminfo(filename); // Do not print in the console [rows,cols,entries,rep,field,symm,comments] = mminfo(filename) | ![]() | ![]() |
In the following example, we extract the information from a file descriptor, as the output of mopen.
In the following example, we analyze a collection of files downloaded from http://math.nist.gov/MatrixMarket.
Copyright (C) 2009 - INRIA - Serge Steer
Copyright (C) 2011 - Benoit Goepfert
Copyright (C) 2011 - DIGITEO - Michael Baudin
http://math.nist.gov/MatrixMarket/formats.html
http://math.nist.gov/MatrixMarket/mmio/matlab/mminfo.m