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

Home » Public Forums » archive » comparing numbers using WHERE doesn't work
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: comparing numbers using WHERE doesn't work [message #25373 is a reply to message #25243] Mon, 04 June 2001 14:24 Go to previous message
John-David T. Smith is currently offline  John-David T. Smith
Messages: 384
Registered: January 2000
Senior Member
"Miklos Z. Kiss" wrote:
>
> Hi folks:
> I have noticed a strange occurence when I try to compare a number with
> all the elements of an array. I'll show my situation in an example.
> Consider the following array:
> a = [2.0000, 2.1000, 2.2000, 2.3000, 2.4000, 2.5000, 2.6000].
> Let, x = 2.2000, y = 2.4000
> So, I want to find which elements of a match up with x and y.
> Naturally, I do the following:
>
> index0 = WHERE(a EQ x)
> index0 = index[0] ; convert from 1-D array to single integer.
> index1 = WHERE(a EQ y)
> index1 = index[0]

What is the vector "index" you reference? I think you must have meant

index0=index0[0]

JD
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: interpolating missing data
Next Topic: Re: IDL 5.4 and MacOS 9.1

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

Current Time: Thu Oct 09 21:59:26 PDT 2025

Total time taken to generate the page: 1.03513 seconds