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

Home » Public Forums » archive » Re: a vector of indices of the largest elements in a vector not exceeding the elements of some other vector
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: a vector of indices of the largest elements in a vector not exceeding the elements of some other vector [message #25727] Fri, 13 July 2001 00:18
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Derek Hullinger wrote:
>
> 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.
>
> **
>
> For example:
>
> if
>
> A=[10,20,30,40]
> B=[12,37]
>
> then
>
> C=[0,2],
>
> because the 0th element in A is the largest value in A that does not
> exceed 12, and the 2nd element in A is the largest value in A that
> does not exceed 37.
>
> **
>
> I have found a way to do this if B is a single floating point value
> (not a vector of values):
>
> temp=max(A<B,C)
>
> but I haven't been able to find a way to do this with a vector B. Any
> ideas?

for some reasons value_locate is the best solution but sometimes not

another routine of our library may be useful.

http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_source/idl_ work/rb_lib/find_indices_by_window.pro
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_source/idl_ html/dbase/download/find_indices_by_window.tar.gz


The difference to value_locate is that your are able to define a window.

We are using this routine by the time synchronisation for means.


regards
Reimar

--
Reimar Bauer

Institut fuer Stratosphaerische Chemie (ICG-1)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
http://www.fz-juelich.de/icg/icg1/
============================================================ ======
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_lib_intro.h tml

http://www.fz-juelich.de/zb/text/publikation/juel3786.html
============================================================ ======

read something about linux / windows
http://www.suse.de/de/news/hotnews/MS.html
[Message index]
 
Read Message
Previous Topic: continents warped to magnetic grid
Next Topic: Re: Looking for IDL code to read Excel spreadsheet

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

Current Time: Fri Oct 10 06:50:54 PDT 2025

Total time taken to generate the page: 0.23466 seconds