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

Home » Public Forums » archive » Re: adding "placeholders" to an array
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: adding "placeholders" to an array [message #48967] Tue, 06 June 2006 15:12 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
pimpk24@hotmail.com writes:


> I was wondering if there is a way to change the dimesions of an
> existing array and to hardwire the new values. It seems that the rebin
> and reform functions only add values by interpolation and nearest
> sampling. I want to predeterming what the new value will be
>
> e.g. Given a random vector, how can I add dimensions of all zero values
>
> 1 4 6 7 8 354 42345
> 0 0 0 0 0 0 0
> 0 0 0 0 0 0 0

The answer to this problem can be found in the Array Concatenation
and Dimensional Juggling Tutorials:

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

For example:

IDL> a = [ 1, 4, 6, 7, 8, 354, 42345L]
IDL> b = LonArr(7,2)
IDL> c = [[a],[b]]
IDL> Print, c
1 4 6 7 8 354 42345
0 0 0 0 0 0 0
0 0 0 0 0 0 0

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: .Reset_Session in a script
Next Topic: iTool identifiers

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

Current Time: Sat Oct 11 13:45:51 PDT 2025

Total time taken to generate the page: 1.44109 seconds