MathGroup Archive 2011

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

Search the Archive

Re: Find position of nonzero elements


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
>
>>
>>



  • Prev by Date: Re: Find position of nonzero elements
  • Next by Date: Inverse of Interpolating Function?
  • Previous by thread: Re: Find position of nonzero elements
  • Next by thread: Re: Find position of nonzero elements