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

Home » Public Forums » archive » matrix multiplication
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: matrix multiplication [message #63168 is a reply to message #63073] Tue, 28 October 2008 14:32 Go to previous messageGo to previous message
russ[1] is currently offline  russ[1]
Messages: 8
Registered: April 2008
Junior Member
On 28 Oct, 20:59, Chris <beaum...@ifa.hawaii.edu> wrote:
> On Oct 28, 8:42 am, David Fanning <n...@dfanning.com> wrote:
>
>
>
>> russ writes:
>>> Probably a stupid question but I haven't used idl for a while
>
>>> Is there a quicker way of doing this?
>
>>> a=fltarr(1000,20)
>>> b=fltarr(20)
>
>>> for i=0,999 do begin
>>>  a(i,*)=a(i,*)*b
>>> endfor
>
>> It might be faster to realize the end result is going
>> to be an array of zeros than it would be to actually
>> write the code. :-)
>
>> But, I think you want this:
>
>>    a = a * rebin(reform(b, 1, 20) ,1000, 20)
>
>> Cheers,
>
>> David
>> --
>> David Fanning, Ph.D.
>> Coyote's Guide to IDL Programming (www.dfanning.com)
>> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
>
> I also like this shortcut for reform:
> a = a * rebin(1#b, 1000, 20)
>
> chris

many thanks to you both

Russ
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: DLM unload
Next Topic: DLM unload

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

Current Time: Sun Oct 12 07:01:30 PDT 2025

Total time taken to generate the page: 2.63937 seconds