Code covered by the BSD License  

Highlights from
Sparse sub access

Sparse sub access


Bruno Luong (view profile)


30 Mar 2009 (Updated )

This package allows to retrieve and assign values of sparse matrix in one shot.

function varargout = getsparse(varargin)
% function v = GETSPARSE(S, r, c)
% PURPOSE: return v(:) = S(r(:), c(:)) for sparse matrix
% Note: This function is useful for sparse because sometime a straight
% forward linear-indexing might not work for large indexes (overflow)
% Author Bruno Luong <>
% Last update: 05/April/2009

nout = max(nargout,1);
vout = cell(1,nout);
[vout{:}] = spsubsref(varargin{:});
varargout = vout;

Contact us