comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Extracting zeros from array
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Extracting zeros from array [message #54033] Sat, 12 May 2007 15:45
yp is currently offline  yp
Messages: 42
Registered: February 2005
Member
On May 12, 10:38 pm, Julio <j...@cpa.unicamp.br> wrote:
> Hello, I have a simple question:
>
> I have a 2D array, like this:
>
> 2 3
> 4 5
> 0 0
> 3 3
> 0 0
> .
> .
> 2 2
>
> Note I have some pairs of zeros. I just want to have another array,
> but without any zero pairs. How can I do to extract these pairs?
>
> Thanks in Advance,
> Julio Cesar

A quick and dirty solution:
result = array[*, where( (array[0,*] ne 0) and (array[1,*] ne 0) ) ]
[Message index]
 
Read Message
Previous Topic: Extracting zeros from array
Next Topic: How to return Values from an options dialog widget to the main program (Pointers)

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 12:58:16 PDT 2025

Total time taken to generate the page: 1.28179 seconds