MathGroup Archive 2011

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

Search the Archive

Re: Find position of nonzero elements


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