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

Home » Public Forums » archive » Re: replicating arrays
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: replicating arrays [message #53043] Sat, 17 March 2007 08:02
Mort Canty is currently offline  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 Go to previous message
Jean H. is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: change colors of IDL shell on OS X?
Next Topic: mosaic_doit : the ghost

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

Current Time: Wed Oct 08 17:55:59 PDT 2025

Total time taken to generate the page: 0.00269 seconds