sparse

PURPOSE ^

SPARSE Create sparse matrix (EIDORS overload for Matlab < R2020a / 9.8).

SYNOPSIS ^

function S = sparse(varargin)

DESCRIPTION ^

SPARSE Create sparse matrix (EIDORS overload for Matlab < R2020a / 9.8).
   S = SPARSE(X) converts a sparse or full matrix to sparse form by
   squeezing out any zero elements.

  See also SPARFUN/SPARSE

 Sparse doesn't work for uint* inputs, so we need to preconvert to double

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function S = sparse(varargin)
0002 %SPARSE Create sparse matrix (EIDORS overload for Matlab < R2020a / 9.8).
0003 %   S = SPARSE(X) converts a sparse or full matrix to sparse form by
0004 %   squeezing out any zero elements.
0005 %
0006 %  See also SPARFUN/SPARSE
0007 %
0008 % Sparse doesn't work for uint* inputs, so we need to preconvert to double
0009 
0010 % (C) 2011 Bartlomiej Grychtol. License: GPL v2 or v3.
0011 % $Id: sparse.m 6829 2024-04-28 09:26:46Z bgrychtol $
0012 
0013 for i= 1:nargin
0014   if ~(isa(varargin{i},'double') || (i == 3 && isa(varargin{i},'logical')))
0015      varargin{i} = double(varargin{i});
0016   end
0017 end
0018 S = builtin('sparse',varargin{:});

Generated on Sun 29-Dec-2024 11:41:59 by m2html © 2005