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

Home » Public Forums » archive » fastest way to find the first non-zero value in an 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
fastest way to find the first non-zero value in an array [message #59680] Tue, 08 April 2008 01:04 Go to previous message
smasson is currently offline  smasson
Messages: 1
Registered: April 2008
Junior Member
Hi,

I want to find the first non-zero value of an array. Is there a faster
way to do this than with the "where" command: (where(array ne 0))[0]
"Where" will look for all non-zero values and I only need the first
one. It would be great if I could stop "where" in its search process
as soon as it found one element...

sebastien
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Stacked Column Bar Plots
Next Topic: Annc: O-Matrix 6.4

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

Current Time: Wed Oct 08 15:53:29 PDT 2025

Total time taken to generate the page: 0.00372 seconds