Re: Find position of nonzero elements
- To: mathgroup at smc.vnet.net
- Subject: [mg120376] Re: Find position of nonzero elements
- From: Dominic Wörner <dominic.woerner at mpi-hd.mpg.de>
- Date: Wed, 20 Jul 2011 06:34:22 -0400 (EDT)
- References: <201107191053.GAA10147@smc.vnet.net> <Pine.LNX.4.63.1107190532290.28777@wopr.wolfram.com>
Thanks Oliver and also Andy. This is very good to know! Am 19.07.2011 um 12:33 schrieb Oliver Ruebenkoenig: > On Tue, 19 Jul 2011, Dominic W=F6rner wrote: > >> Hi, >> >> How can I find the indices i and j of all nonzero elements of a matrix. >> I want that because there are only some nonzero elements in a huge >> matrix. >> >> Best regards, >> Dominic > > Dominic, > > how about > > sa = SparseArray[IdentityMatrix[4]] > sa["Properties"] > sa["NonzeroPositions"] > > Oliver > >> >>
- References:
- Find position of nonzero elements
- From: Dominic Wörner <dominic.woerner@mpi-hd.mpg.de>
- Find position of nonzero elements