Home »
Public Forums »
archive »
Re: a vector of indices of the largest elements in a vector not exceeding the elements of some other vector
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
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
|
|
|
Current Time: Wed Oct 08 19:11:39 PDT 2025
Total time taken to generate the page: 0.00587 seconds