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

Home » Public Forums » archive » How to locate a "NaN"?
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
How to locate a "NaN"? [message #56267] Mon, 08 October 2007 23:12
mystea is currently offline  mystea
Messages: 16
Registered: October 2007
Junior Member
Hello All,

I have a array of length 100. A significant portion of them is
recorded as NaN. Now I want to figure out what is the largest index of
the element that contains a valid number, then assign its value to
these NaN entries.

I thought it would be easy and tried:

IDL> k=max(where(myarray[*] ne !VALUES.D_NAN))

but it does not work! k equals to 99 in this case. what's really
strange is the following:

IDL> help, myarray[50]
<Expression> DOUBLE = NaN

IDL>print, (myarray[50] eq !VALUES.D_NAN)
0
(so I think this means myarray[50] is double, is NAN, yet is not !
VALUES.D_NAN)

In short, the problem is, how to locate array elements whose values
are NaN?
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: How to declare a constant variable?
Next Topic: Re: How to declare a constant variable?

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

Current Time: Wed Oct 08 13:49:42 PDT 2025

Total time taken to generate the page: 0.00537 seconds