I have a question concerning your webpage http://www.gnu.org/software/octave/doc/interpreter/Sparse-Matrices-with-Mex_002dFiles.html I'm trying to construct a sparse matrix using the boost ublas libraries. My problem is that I cannot return the sparse matrix to mex and octave/matlab. In you webpage is explained how to pass a sparse matrix to c, but can you help me to pass a sparse matrix from c to octave/matlab?