[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

*Subject*: Re: a vector of indices of the largest elements in a vector not exceeding the elements of some other vector*From*: Craig Markwardt <craigmnet(at)cow.physics.wisc.edu>*Date*: 12 Jul 2001 13:58:48 -0500*Newsgroups*: comp.lang.idl-pvwave*Organization*: U. Wisc. Madison Physics -- Compact Objects*References*: <eb6d3332.0107121005.52873301@posting.google.com>*Reply-To*: craigmnet(at)cow.physics.wisc.edu*Xref*: news.doit.wisc.edu comp.lang.idl-pvwave:25677

derek@milkyway.gsfc.nasa.gov (Derek Hullinger) writes: > I have two vectors of different sizes (say, A and B): > > A contains floating point values that increase with index > B contains floating point values > > I'd like to create a third vector, C (which would be the same size as > B) such that: > > The nth element in C contains the index of the largest element in A > that does not exceed the nth element in B. What you are asking for is *exactly* what is provided by the VALUE_LOCATE function, which appeared in IDL 5.3. If you are not so up-to-date, then check out the slick replacement for VALUE_LOCATE on my web page. c = value_locate(a, b) Craig http://cow.physics.wisc.edu/~craigm/idl/idl.html (under Arrays) -- -------------------------------------------------------------------------- Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response --------------------------------------------------------------------------

**References**:

- Prev by Date:
**Õîòèòå ïëàòèòü çàìîáèëüíûéÌÅÍÜØÅ?!?!?!** - Next by Date:
**continents warped to magnetic grid** - Prev by thread:
**a vector of indices of the largest elements in a vector not exceeding the elements of some other vector** - Next by thread:
**Re: a vector of indices of the largest elements in a vector not exceeding the elements of some other vector** - Index(es):