[R] Matrix multiplication (with multidimensional array)

Tong Wang wangtong at usc.edu
Mon Jun 25 04:27:19 CEST 2007


Hi All,
     I am wondering if there is an efficient  way to do the following matrix multiplication,
a[1,,]       1, 2
                3, 4

a[2,,]       4, 3
                2, 1
 
b[1,,]        5,6
                 7,8

b[2,,]        8,7
                 6,5

I need the result c, with

c[1,,] = a[1,,] %*% b[1,,]
c[2,,] = a[2,,] %*% b[2,,] 

Thanks in advance for any help.



More information about the R-help mailing list