spDenseSubmat ============================================== Purpose ---------------- Returns a dense submatrix of a sparse matrix. Format ---------------- .. function:: y = spDenseSubmat(x, rinds, cinds) :param x: data :type x: MxN sparse matrix :param rinds: row indices. :type rinds: Kx1 vector :param cinds: column indices. :type cinds: Lx1 vector :return y: the intersection of *rinds* and *cinds*. :rtype y: KxL dense matrix Examples ---------------- :: sparse matrix y; x = { 0 0 0 10, 0 2 0 0, 0 0 0 0, 5 0 0 0, 0 0 0 3 }; // Set 'y' to be a sparse matrix with the same values as 'x' y = denseToSp(x, 0); // Extract a submatrix from 'y' with all rows of 'y' and // columns 1, 3 and 4 d = spDenseSubmat(y, 0, 1|3|4); Now *d* is equal to: :: 0 0 10 0 0 0 0 0 0 5 0 0 0 0 3 Remarks ------- If *rinds* or *cinds* are scalar zeros, all rows or columns will be returned. .. seealso:: Functions :func:`spSubmat`