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 #63080 is a reply to message #911] Tue, 28 October 2008 11:42 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
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.")
[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 Nov 30 14:25:22 PST 2025

Total time taken to generate the page: 0.28240 seconds