How to append a multi dimensional array? [message #74254] |
Wed, 05 January 2011 03:01 |
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
|
|
|