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

Home » Public Forums » archive » Array concatenation
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 [message #58487 is a reply to message #48962] Thu, 31 January 2008 00:43 Go to previous messageGo to previous message
Wox is currently offline  Wox
Messages: 184
Registered: August 2006
Senior Member
On Wed, 30 Jan 2008 07:56:51 -0800 (PST), "Ryan."
<rchughes@brutus.uwaterloo.ca> wrote:

> Hi All,
>
> I'm trying to add a 1x2 array to the end of an Nx2 array to obtain a (N
> +1)x2 array using the square bracket concatenation trick, but based on
> my limited understanding of it, I can't get it to work. I've looked
> at JD's tutorial on David's website but I still don't get it.
>
> Here is an example of what I want to do:
> IDL> array = [[1,2,3,4],[1,2,3,4]]
> IDL> print, array
> 1 2 3 4
> 1 2 3 4
>
> I want to add another pair to the array to get this:
> 1 2 3 4 5
> 1 2 3 4 5
>
> I want to execute a command similar to this one but I can't figure out
> the correct number of brackets:
> array = [[array], [[5,5]]]
>
> Thanks,
> Ryan.

Yet another possibility:

IDL> array = [[1,2,3,4],[1,2,3,4]]
IDL> array = [array,[[5],[5]]]
IDL> print,array
1 2 3 4 5
1 2 3 4 5
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: IDL slow to load command prompt
Next Topic: The usage of PS_END

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

Current Time: Wed Oct 08 15:27:11 PDT 2025

Total time taken to generate the page: 0.00441 seconds