MatrixMarket file format - Maple Help

# Online Help

###### All Products    Maple    MapleSim

Home : Support : Online Help : Programming : Input and Output : File Formats : Formats/MatrixMarket

MatrixMarket (.mtx) File Format - MatrixMarket file format

Description

 • MatrixMarket is a format for the storage of dense or sparse numeric matrix data.
 • This open format was created and is used by the National Institute of Standards and Technology (NIST).
 • The commands Import, Export, ImportMatrix, and ExportMatrix can read and write to the MatrixMarket format.

Examples

Import a 100x100 Hilbert matrix in Matrix Market format.

 > $\mathrm{hilbert}:=\mathrm{FileTools}:-\mathrm{JoinPath}\left(\left["example/hilbert100.mtx"\right],\mathrm{base}=\mathrm{datadir}\right)$
 ${"C:\Program Files\Maple 2015\data\example\hilbert100.mtx"}$ (1)
 > $\mathrm{Import}\left(\mathrm{hilbert}\right)$
 $\left[\begin{array}{c}{\mathrm{100 x 100}}{\mathrm{Matrix}}\\ {\mathrm{Data Type:}}{{\mathrm{float}}}_{{8}}\\ {\mathrm{Storage:}}{\mathrm{rectangular}}\\ {\mathrm{Order:}}{\mathrm{Fortran_order}}\end{array}\right]$ (2)

Export a random 100x100 matrix to the home directory of the current user

 > $\mathrm{mtxFile}:=\mathrm{FileTools}:-\mathrm{JoinPath}\left(\left["example.mtx"\right],\mathrm{base}=\mathrm{homedir}\right)$
 ${"/Users/JohnSmith/example.mtx"}$ (3)
 > $M:=\mathrm{LinearAlgebra}:-\mathrm{RandomMatrix}\left(100,\mathrm{datatype}={\mathrm{float}}_{8}\right):$
 > $\mathrm{ExportMatrix}\left(\mathrm{mtxFile},M\right)$
 ${234927}$ (4)
 See Also

## Was this information helpful?

 Please add your Comment (Optional) E-mail Address (Optional) What is ? This question helps us to combat spam