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

Home » Public Forums » archive » Re: N_ELEMENTS gt 0
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: N_ELEMENTS gt 0 [message #58674] Thu, 14 February 2008 02:00
Maarten[1] is currently offline  Maarten[1]
Messages: 176
Registered: November 2005
Senior Member
On Feb 14, 9:37 am, chloesharro...@gmail.com wrote:
> Is it possible to combine the N_ELEMENTS function with the greater
> than operator? I just want to search through an array and find out
> how many elements exist which are greater than zero (I don't need to
> know where they are, just how many), but I can't get it to work.

[snip]

> Is there a way to do this without using a where function?

Yes, either use where() if you may need the indices later on, or
number = total(good_index gt 0, /int)
This relies on 'truth' being equal to 1 and 'false' equal to 0.

Maarten
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: 5th & 95th Percentiles
Next Topic: Why doesn't this return the correct value?

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

Current Time: Wed Oct 08 15:56:41 PDT 2025

Total time taken to generate the page: 0.00438 seconds