accumdim with sparse output

Nir Krakauer <[email protected]>
Newsgroups gmane.comp.gnu.octave.general
Message-ID <CAK0qmq4EK5Vnp-zQLXtzz861B1153byrROSCWQ-xq-c0nLEUDw@mail.gmail.com>
Is it possible to keep the output of accumdim sparse, similar to
accumarray with issparse=true? If not, is there a way to use
accumarray to get the same result?


I'm thinking of an application like

n = 1E3;
S = sprand (n, n, 1E-3);
inds = repmat(1:(n/2), 1, 2);
Snew = accumdim(inds, accumdim(inds, S, 1, [], @max), 2, [], @max);
#should be sparse
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.