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

Home » Public Forums » archive » Re: array concatenation in 2-D
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: array concatenation in 2-D [message #59624 is a reply to message #59623] Fri, 04 April 2008 12:40 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
R.G. Stockwell writes:

> If it is always 2 columns by whatever rows, then just concatenate the
> arrays.
> (you may have to do some tranposes)
>
> If there is a variable number of columns, then as David says, pointers.

Oh, here (for those you don't have time to read
the Dimensional Juggling and Pointer tutorials):

PRO Example
arrayptr = Ptr_New()
seed = -3L
FOR j=0,9 DO BEGIN
points = Randomu(seed, 2)
Print, 'Points: ', points
IF j EQ 0 THEN $
arrayptr = Ptr_New(points) ELSE $
*arrayptr = [[Temporary(*arrayptr)],[points]]
ENDFOR

Print, 'Print Values in Pointer'
Print, *arrayPtr
Ptr_Free, arrayPtr
END

Results in:

Points: 0.897916 0.558249
Points: 0.766930 0.589101
Points: 0.0603181 0.973112
Points: 0.0378892 0.218058
Points: 0.142394 0.984703
Points: 0.894904 0.947651
Points: 0.804079 0.160385
Points: 0.208246 0.818130
Points: 0.103716 0.741117
Points: 0.0134482 0.0960160
Print Values in Pointer
0.897916 0.558249
0.766930 0.589101
0.0603181 0.973112
0.0378892 0.218058
0.142394 0.984703
0.894904 0.947651
0.804079 0.160385
0.208246 0.818130
0.103716 0.741117
0.0134482 0.0960160

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: No removal of "NaN" while plotting on both PLOT and iPLOT
Next Topic: Re: Tilde with IDL

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

Current Time: Sat Oct 11 00:39:57 PDT 2025

Total time taken to generate the page: 0.71925 seconds