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

Home » Public Forums » archive » How to append a multi dimensional array?
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
How to append a multi dimensional array? [message #74254] Wed, 05 January 2011 03:01
Balt is currently offline  Balt
Messages: 16
Registered: May 2010
Junior Member
Hi all,

a seemingly trivial problem and I can't get my head around it. Does
anyone see the solution?

Given:
IDL> x = [1,2,3]
IDL> y = [4,5,6]
IDL> bigarray = [[x], [y]]
IDL> help,bigarray
BIGARRAY INT = Array[3, 2]

Except, I can't do it like that, because I need to create BIGARRAY
step by step, i.e. there are steps that require bigarray to already
exist when y is calculated. And y then needs to be dynamically added
to bigarray.

How can I add a vector to an array generically? In "pseudo code", I
need to be able to say bigarray[0] = x, then later bigarray[1] = y and
so forth... all with dynamic (and automatic) resizing of bigarray, of
course... :-)

I suspect this is really simple and I've done similar things like
adding a single element to an array dynamically ( array = [[array],
newval] ) but this doesn't work when newval is a vector!

Any hints greatly appreciated!

- Balt
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Associating GeoTiFF tags with basic Mercator projection parameters?
Next Topic: Fatal error when opening an image file

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

Current Time: Wed Oct 08 13:31:46 PDT 2025

Total time taken to generate the page: 0.00739 seconds