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

Home » Public Forums » archive » Re: Concatenate arrays of different dimensions
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: Concatenate arrays of different dimensions [message #51171 is a reply to message #51168] Wed, 08 November 2006 09:31 Go to previous messageGo to previous message
cgguido is currently offline  cgguido
Messages: 195
Registered: August 2005
Senior Member
I seem to remember that concatenation is slow with big arrays or
something...

If you have to do this often (especially inside a loop!) and if you can
put a higher limit on the number of rows, I would do:

a=fltarr(40,N) ; you would do this outside the loop, if any.
; where N is a number that is an over estimate of the size you will
need at the end.

a[*]=-1
; or some value you know won't appear in real data. I seem to only ever
encounter positive ; numbers :-) Dunno if you could fill it with
NaNs....

;now you fill a with your sub arrays
a[*,0:29]=f
a[*,30:300+29]=f1
a[*,330:3330+329]=f2

;finaly clean it up
b=a[where(a[*] ne -1)]
a=0

Or someting along these lines anyway... hope this helps.

Gianguido
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: array juggling
Next Topic: Array juggling help needed

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

Current Time: Fri Oct 10 04:52:04 PDT 2025

Total time taken to generate the page: 0.72036 seconds