Matlab Sparse Matrix
converted to
Harwell Boeing Sparse Matrix File

MSM_TO_HB is a MATLAB library which accepts a Matlab sparse matrix and writes it to a file in the Harwell Boeing (HB) Sparse Matrix File Format, the original version being by Xiaoye Li.

The original version has been modified. In particular, an effort was made to allow the input of complex matrices.


I don't care what you do with this code.


MSM_TO_HB is available in a MATLAB version.

Related Data and Programs:

HB_IO, a MATLAB library which reads and writes sparse linear systems stored in the Harwell-Boeing Sparse Matrix format.

HB_TO_MSM, a MATLAB program which converts a Harwell Boeing sparse matrix to MATLAB sparse matrix format.

MM_TO_HB, a MATLAB program which reads the sparse matrix information from an MM Matrix Market file and writes a corresponding HB Harwell Boeing file.

MM_TO_MSM, a MATLAB program which reads a Matrix Market file defining a sparse matrix, and creates a corresponding MATLAB sparse matrix data structure.

MSM_TO_MM, a MATLAB program which writes a MATLAB sparse matrix to a Matrix Market (MM) file;

PLASMA_MATRIX, a MATLAB library which demonstrates how a large sparse MATLAB matrix can be written to or read from a Harwell-Boeing sparse matrix file.

ST_TO_HB, a MATLAB program which converts a sparse matrix file from ST format to Harwell Boeing (HB) format;

TEST_MAT, a MATLAB library which defines test matrices with known inverses, determinants, eigenvalues and so on.


Original verson by Xiaoye Li, University of California at Berkeley.
This modified version by John Burkardt.


  1. Iain Duff, Roger Grimes, John Lewis,
    User's Guide for the Harwell-Boeing Sparse Matrix Collection,
    October 1992.

Source Code:

You can go up one level to the MATLAB source codes.

Last revised on 18 July 2017.