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

Home » Public Forums » archive » Re: adding "placeholders" to an 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: adding "placeholders" to an array [message #48968 is a reply to message #48967] Tue, 06 June 2006 15:02 Go to previous messageGo to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
pimpk24@hotmail.com wrote:
> I was wondering if there is a way to change the dimesions of an
> existing array and to hardwire the new values. It seems that the rebin
> and reform functions only add values by interpolation and nearest
> sampling. I want to predeterming what the new value will be
>
> e.g. Given a random vector, how can I add dimensions of all zero values
>
> 1 4 6 7 8 354 42345
> 0 0 0 0 0 0 0
> 0 0 0 0 0 0 0
>
>
> thanks in advance
>

You can't change the size of the array without recreating and copying:

IDL> v = [1L, 4L, 6L, 7L, 8L, 354L, 42345L]
IDL> newv = lonarr(7, 3)
IDL> newv[0, 0] = reform(v, 7, 1)
IDL> print, newv
1 4 6 7 8 354
42345
0 0 0 0 0 0
0
0 0 0 0 0 0
0

Mike
--
www.michaelgalloy.com
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: .Reset_Session in a script
Next Topic: iTool identifiers

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

Current Time: Sat Nov 29 05:55:00 PST 2025

Total time taken to generate the page: 0.16241 seconds