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

Home » Public Forums » archive » Matrix a*b in loop
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 a*b in loop [message #89052 is a reply to message #89043] Sat, 19 July 2014 13:31 Go to previous message
Mats Löfdahl is currently offline  Mats Löfdahl
Messages: 263
Registered: January 2012
Senior Member
Den torsdagen den 17:e juli 2014 kl. 23:16:29 UTC+2 skrev Gompie:
> Hi,
>
> I have a simple question.
>
>
>
> I have two matricies A (696 , 1523854 ) and B (1,696) Matrix .
>
> I wish to have a matrix c whose each row is a product of rows elements of a and b i.e a*b
>
>
>
> I can do it in a loop by saying a(:,i)*b but it takes a lot of time because I (~1523854 ) would be very large number. Is it possible to do it in one go.

Is this what you want to do?

IDL> a = randomu(seed,696,1523854)
IDL> b = randomu(seed,1,696)
IDL> help,a,b
A FLOAT = Array[696, 1523854]
B FLOAT = Array[1, 696]
IDL> c = a ## b
IDL> help,c
C FLOAT = Array[1, 1523854]

http://www.exelisvis.com/docs/Matrix_Operators.html
http://www.exelisvis.com/docs/matrix_multiply.html
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: How to disable tick labels on right and top when using cgMap?
Next Topic: MIN(), MAX() with NaN values

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

Current Time: Fri Oct 10 02:30:48 PDT 2025

Total time taken to generate the page: 0.71918 seconds