MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Find position of nonzero elements

  • To: mathgroup at smc.vnet.net
  • Subject: [mg120377] Re: Find position of nonzero elements
  • From: Sseziwa Mukasa <mukasa at gmail.com>
  • Date: Wed, 20 Jul 2011 06:34:33 -0400 (EDT)
  • References: <201107191053.GAA10147@smc.vnet.net>

Position[matrix,Except[0]]

If it's machine precision you may need to do

Position[matrix,Except[0.]]

On Jul 19, 2011, at 6:53 AM, 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
>



  • Prev by Date: Re: Using Plot3D; rotating the plot but, getting a different image after exporting.
  • Next by Date: Plotting a star map
  • Previous by thread: Re: Find position of nonzero elements
  • Next by thread: Re: Find position of nonzero elements