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

Home » Public Forums » archive » Re: Expanding array with counts from another array
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: Expanding array with counts from another array [message #51517 is a reply to message #51508] Thu, 23 November 2006 07:23 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Guenter Lichtenberg writes:

> 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.

http://www.dfanning.com/idl_way/chunkindex.html

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Previous Topic: Natural Neighbor Interpolation
Next Topic: Re: write_png weirdness

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

Current Time: Mon Dec 01 16:00:19 PST 2025

Total time taken to generate the page: 0.02263 seconds