This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

MTX (.mtx)

Matrix Market matrix format.
Used for exchanging and storing test matrices.
Plain text format.
File format of the NIST Matrix Market collection of standard test matrices.
Stores numerical or pattern matrices in a dense ("array format") or sparse ("coordinate format") representation.
Developed in 1996 by R. Boisvert, R. Pozo, K. Remington, and J. Dongarra.
Maintained by the U.S. National Institute of Standards and Technology (NIST).
  • Import and Export fully support the Matrix Market file format.
  • Import imports matrix data from a Matrix Market file.
  • Export exports any numerical or pattern matrix to a Matrix Market file.
  • Import reads an MTX matrix file and returns an array.
  • Mathematica converts "array format" files to packed arrays and "coordinate format" files to sparse arrays.
  • Import imports the specified element from a Matrix Market file.
  • Import imports multiple elements.
  • Export creates a Matrix Market file by treating expr as specifying element elem.
  • Export treats each as specifying the corresponding .
  • Export exports expr with the specified option elements taken to have the specified values.
  • Export uses rules to specify the elements to be exported.
  • See the reference pages for full general information on Import and Export.
"Elements"list of elements and options available in this file
"Rules"full list of rules for each element and option
"Options"list of rules for options, properties, and settings
  • Data representation elements:
"Data"matrix data given as a packed or sparse array
"Graphics"a visual representation of the values of the matrix elements
  • Import uses the element by default.
  • Meta-information elements:
"Comments"user comments stored in the file
"MatrixStructure"symmetry properties of the matrix
  • Possible values for are:
"Hermitian"matrix that is equal to its own conjugate transpose
"General"matrix without transposition symmetry
"SkewSymmetric"matrix whose transpose is also its negative
"Symmetric"matrix that is equal to its transpose
This imports a sparse matrix from an MTX sample file, giving a visual representation of it:
Import this file as a sparse array object:
This exports a 2×2 matrix to MTX:
This imports a sparse matrix from an MTX sample file, giving a visual representation of it:
In[1]:=
Click for copyable input
Out[1]=
Import this file as a sparse array object:
In[2]:=
Click for copyable input
Out[2]=
 
This exports a 2×2 matrix to MTX:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=