From: blaž on
hi,

i wish to define a sparse matrix with c mex file? To be more specific, i want to make a sparse matrix from a n x 3 matrix. The first two columns are defining the i,j (there are n of them) indices in the sparse matrix and the third column contains the values to go with the i,j indices. I know i have to use mxCreateSparse function, but how to asign the values to specific locations which i know according to the input matrix.

thanks a lot, blaz
From: Rune Allnor on
On 15 Feb, 17:18, "bla&#382; " <blaz.kr...(a)siol.net> wrote:
> hi,
>
> i wish to define a sparse matrix with c mex file? To be more specific, i want to make a sparse matrix from a n x 3 matrix. The first two columns are defining the i,j (there are n of them) indices in the sparse matrix and the third column contains the values to go with the i,j indices. I know i have to use mxCreateSparse function, but how to asign the values to specific locations which i know according to the input matrix.

There is a link to an example c file where this is demonstrated,
in the on-line documentation of mxCreateSparse.

Rune
 | 
Pages: 1
Prev: Basic OLS question?
Next: Update string in listbox