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

Home » Public Forums » archive » N_ELEMENTS gt 0
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
N_ELEMENTS gt 0 [message #58676] Thu, 14 February 2008 01:37 Go to previous message
chloesharrocks is currently offline  chloesharrocks
Messages: 16
Registered: January 2008
Junior Member
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. I
have an array called good_index which I happen to know has 6 values >
zero, but when I run the following code, it tells me I only have 1
value > zero:

number = (N_ELEMENTS(good_index) gt 0)
print, number

Is there a way to do this without using a where function?
Thanks
ChloƩ
[Message index]
 
Read Message
Read Message
Previous Topic: print and precision
Next Topic: keyboard shortcut in IDL 7

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

Current Time: Fri Oct 10 09:38:33 PDT 2025

Total time taken to generate the page: 0.40385 seconds