Expanding array with counts from another array [message #51519] |
Thu, 23 November 2006 07:05 |
G. Lichtenberg
Messages: 2 Registered: November 2006
|
Junior Member |
|
|
Hi -
I have a the following problem:
I have two vectors, V with occurring values and C with the number of times
the values occur (both in the correct order and V sorted). I know want to
create an expanded array that contains for each element of V C copies
(loopless if possible). Let's say
V = [3,10,666]
C = [1,2,3]
=>
R = [3,10,10,666,666,666]
(For those who are interested: I use V and C to store a much larger array in
a compact way, but have to expand it again to assign the correct counts to
individual detector pixels - if that makes any sense to you. And I have of
course not three but tens of thousands of values)
I am pretty sure that a solution was probably posted ages ago already, but
could not find it yet. Pointers to a solution are appreciated.
TIA
gl
--
G. Lichtenberg
|
|
|