replicating arrays [message #53050] |
Fri, 16 March 2007 16:30  |
Christopher Thom
Messages: 66 Registered: October 2006
|
Member |
|
|
Hi,
My brain has stopped working on friday afternoon, so a quick question. I
have an array, and I want to make a multi-dimensional array, which is
simply copies of the old array, a la
newarray = replicate(array, 5)
where I would expect the result to be array[n_elements(array), 5].
Is this possible in a simple way? replicate only accepts scalars...
cheers
chris
|
|
|
|
Re: replicating arrays [message #53138 is a reply to message #53050] |
Sat, 17 March 2007 10:36  |
lasse
Messages: 48 Registered: February 2007
|
Member |
|
|
On 16 Mar, 23:30, Christopher Thom <c...@oddjob.uchicago.edu> wrote:
> Hi,
>
> My brain has stopped working on friday afternoon, so a quick question. I
> have an array, and I want to make a multi-dimensional array, which is
> simply copies of the old array, a la
>
> newarray = replicate(array, 5)
>
> where I would expect the result to be array[n_elements(array), 5].
>
> Is this possible in a simple way? replicate only accepts scalars...
>
> cheers
> chris
You might be interested to downloaded cmreplicate from here:
http://cow.physics.wisc.edu/~craigm/idl/, which does the trick.
Cheers
Lasse
|
|
|