Re: replicating arrays [message #53043] |
Sat, 17 March 2007 08:02 |
Mort Canty
Messages: 134 Registered: March 2003
|
Senior Member |
|
|
Jean H. schrieb:
>
> IDL> a = [1,2,3]
> IDL> print, transpose(reform(rebin(a, 12),4,3))
> 1 2 3
> 1 2 3
> 1 2 3
> 1 2 3
>
> jean
But be sure to use /SAMPLE with REBIN if it's a float array that you're
replicating.
Cheers
Mort Canty
|
|
|
Re: replicating arrays [message #53049 is a reply to message #53043] |
Fri, 16 March 2007 17:34  |
Jean H.
Messages: 472 Registered: July 2006
|
Senior Member |
|
|
Christopher Thom 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
IDL> a = [1,2,3]
IDL> print, transpose(reform(rebin(a, 12),4,3))
1 2 3
1 2 3
1 2 3
1 2 3
jean
|
|
|