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

Home » Public Forums » archive » WHERE problems (longish)
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: Where problem [message #69607 is a reply to message #35914] Fri, 05 February 2010 04:01 Go to previous messageGo to previous message
d.poreh is currently offline  d.poreh
Messages: 406
Registered: October 2007
Senior Member
On Feb 4, 8:20 am, JJ <j...@cornell.edu> wrote:
> The value_locate() solution may work for you, but it will really only
> work in pretty specific cases.  The X vector must be monotonically
> increasing (though you could first sort the list).  Even if the values
> you're looking for are not in X, a valid result will be returned -
> since value_locate() returns the index of the start of the "interval
> into which the given value falls" (this issue addressed by wox).
>
> If you want a simple and robust solution to this kind of problem (and
> many others), I highly recommend Craig Markwardt's cmset_op routine
> (follow the Array/Set link from the Markwardt IDL Library page athttp://www.physics.wisc.edu/~craigm/idl/idl.html).
>
> With cmset_op you would do something like:
>
> index = cmset_op (x, 'and', y, /index)
>
> Of course, if there are multiple entries in your array that have the
> same value, and you want to find the indices of all of those
> locations, you might want to do a where on each element of y.
>
> -JJ

Thanks JJ.
Cheers
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: questions onn symbol and fonts
Next Topic: File Delete -- Friggin A!!

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

Current Time: Wed Oct 08 17:43:55 PDT 2025

Total time taken to generate the page: 0.00441 seconds