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

Home » Public Forums » archive » Re: Arrays merging
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
Re: Arrays merging [message #47493] Wed, 15 February 2006 09:15 Go to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Benjamin Hornberger writes:

> Julio wrote:
>>
>> ARRAY1 STRING = Array[15, 4]
>> ARRAY2 STRING = Array[15, 6]
>>
>> I need to merge these two arrays into 1. I'm using:
>>
>
> Try
>
> Array3 = [[array1], [array2]]
>
> and have a look at http://www.dfanning.com/tips/array_concatenation.html.

I guess Julio better specify how he wants his array
concatenated. I just took him at his word. :-)

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: Arrays merging [message #47494 is a reply to message #47493] Wed, 15 February 2006 09:11 Go to previous messageGo to next message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
Julio wrote:
> Hello, I have an easy question. I have two arrays:
>
> help, array1
> help, array2
>
> ARRAY1 STRING = Array[15, 4]
> ARRAY2 STRING = Array[15, 6]
>
> I need to merge these two arrays into 1. I'm using:
>
> Array3 = [array1, array2]
>
> But it doesn't work, since the dimensions do not agree. How can I do to
> concatenate these two arrays? How can I fill with zero values the
> array1 to match it with array2??

Try array3 = [[array1],[array2]]

IDL> x1=strarr(15,4)
IDL> x2=strarr(15,6)
IDL> help, x1, x2
X1 STRING = Array[15, 4]
X2 STRING = Array[15, 6]
IDL> help, [[x1],[x2]]
<Expression> STRING = Array[15, 10]

paulv


--
Paul van Delst
CIMSS @ NOAA/NCEP/EMC
Re: Arrays merging [message #47495 is a reply to message #47494] Wed, 15 February 2006 09:06 Go to previous messageGo to next message
Benjamin Hornberger is currently offline  Benjamin Hornberger
Messages: 258
Registered: March 2004
Senior Member
Julio wrote:
>
> ARRAY1 STRING = Array[15, 4]
> ARRAY2 STRING = Array[15, 6]
>
> I need to merge these two arrays into 1. I'm using:
>

Try

Array3 = [[array1], [array2]]

and have a look at http://www.dfanning.com/tips/array_concatenation.html.

Good luck,
Benjamin
Re: Arrays merging [message #47496 is a reply to message #47495] Wed, 15 February 2006 09:09 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Julio writes:

> Hello, I have an easy question. I have two arrays:
>
> help, array1
> help, array2
>
> ARRAY1 STRING = Array[15, 4]
> ARRAY2 STRING = Array[15, 6]
>
> I need to merge these two arrays into 1. I'm using:
>
> Array3 = [array1, array2]
>
> But it doesn't work, since the dimensions do not agree. How can I do to
> concatenate these two arrays? How can I fill with zero values the
> array1 to match it with array2??

Array4 = StrArr(15,6)
array4[0,0] = array1
array3 = [array4, array2]

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: Arrays merging [message #47592 is a reply to message #47493] Wed, 15 February 2006 09:33 Go to previous message
Julio[1] is currently offline  Julio[1]
Messages: 52
Registered: May 2005
Member
Hi, I tried the tips, and David's worked fine!

Thanks for all the comments,

Cheers,
Julio
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Arrays merging
Next Topic: Newbie to satellite data and IDL

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

Current Time: Thu Oct 09 09:21:03 PDT 2025

Total time taken to generate the page: 3.83890 seconds