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

Home » Public Forums » archive » Re: How to increase array size by 1
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: How to increase array size by 1 [message #72020] Wed, 04 August 2010 12:57
Fermiona Fermiona is currently offline  Fermiona Fermiona
Messages: 17
Registered: June 2010
Junior Member
Thank you David
Re: How to increase array size by 1 [message #72021 is a reply to message #72020] Wed, 04 August 2010 12:13 Go to previous message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Aug 4, 3:57 pm, Fermiona Fermiona <fermion...@gmail.com> wrote:
> Hello
>
> I have a 2D array:
>
> xyz = fltarr (5,Size)
>
> How can I increase the number of rows to Size+1?
>
> Thank you

xyz=[[xyz],[fltarr(5)]]
Re: How to increase array size by 1 [message #72022 is a reply to message #72021] Wed, 04 August 2010 12:12 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Fermiona Fermiona writes:

> I have a 2D array:
>
> xyz = fltarr (5,Size)
>
> How can I increase the number of rows to Size+1?

IDL> size = 8
IDL> xyz = fltarr (5,Size)
IDL> xyz = [ [xyz], [fltarr(size)] ]
IDL> help, xyz
XYZ FLOAT = Array[5, 9]

You can find more on "Array Concatenation" here:

http://www.dfanning.com/tips/array_concatenation.html

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: How to increase array size by 1
Next Topic: Re: select first n elements of array without loop

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

Current Time: Sat Oct 11 12:48:38 PDT 2025

Total time taken to generate the page: 0.16058 seconds