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

Home » Public Forums » archive » Assigning the values of a matrix to a larger matrix
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: Assigning the values of a matrix to a larger matrix [message #88470 is a reply to message #88468] Wed, 30 April 2014 16:05 Go to previous messageGo to previous message
Fabrice Lambert is currently offline  Fabrice Lambert
Messages: 6
Registered: March 2012
Junior Member
Hello Heinz,

That works, thanks a lot!

I find it very counter-intuitive, though: In my example to fill in the values we want in the 3rd dimension of the base vector, we have to create a 4th dimension where every index contains a copy of the original 3d-input vector.

Is there an easy way to understand that logic?

Thanks,
Fabrice

On Wednesday, April 30, 2014 5:21:35 PM UTC-4, Heinz Stege wrote:
> Hello Fabrice.
>
>
>
>
>
>
>> Is there a way to write the following code in IDL/GDL without a for loop?
>
>>
>
>> for i=0,90 do begin
>
>> Base[*,*,i]=Input[*,*,0]
>
>> endfor
>
>
>
> Yes, you can write:
>
>
>
> n=size(input,/dimensions)
>
> base[0,0,0]=rebin(input,[n,91],/sample)
>
>
>
> If the base array does not have to be bigger than the 91x input
>
> array, you don't need to create it explicitly and can more simply
>
> write:
>
>
>
> n=size(input,/dimensions)
>
> base=rebin(input,[n,91],/sample)
>
>
>
> Cheers, Heinz
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: ENVI_GLT_DOIT and ENVI_GEOREF_FROM_GLT_DOIT
Next Topic: GDL weirdness (bug?) with modulo command

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

Current Time: Wed Jul 15 10:36:39 PDT 2026

Total time taken to generate the page: 0.72114 seconds