Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Worksheet Functions / October 2006

Tip: Looking for answers? Try searching our database.

Matrix multiplication using sumproduct

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rasoul Khoshravan - 15 Oct 2006 16:29 GMT
In some engineering calculations, we have multiplication of matrices or
matrices and vectors.

It is defined as follows by an example:

[A]= 2  3  5 (an array of  3 rows and 3 columns)

        2  4  6

        1  -2 4

[B]= 6 (an array of 3 rows and 1 column)

       -5

        1

[A] *[B] = 2*6+3*(-5)+5*1

                  2*6+4*(-5)+6*1

                  1*6+(-2)*(-5)+4*1

[A] *[B] = 2 (an array of 3 rows and 1 column)

             -2

             20

For long time, I was performing this task by simple multiplication and
summation. Recently through this ng, I came to know about SUMPRODUCT command
and thought of writing a command to do matrices multiplication. I came to
following command which satisfies me. If you know any better way for
matirces multiplication, let me know. In real engineering problems sometimes
we have to perform this task for very big matrices like (100 rows by 100
columns, and even bigger ones) for calculation of inverse of a matrix, which
makes it very time consuming. For this reason approximate methods are
introduced. I was wondering if these calculations will be time-consuming in
Excel or not.

[A] from a1 to c3
[B] from d1 to d3
[A]*[B] from e1 to e3

In e1 I enter:
sumproduct(a1:c1,transpose(d$1:d$3)) entered as array formula (CSE)
drag the top formula to e2 and e3.
JMB - 16 Oct 2006 04:05 GMT
Try selecting E1:E3, enter
=MMULT($A$1:$C$3,$D$1:$D$3)
confirmed w/CSE

> In some engineering calculations, we have multiplication of matrices or
> matrices and vectors.
[quoted text clipped - 43 lines]
> sumproduct(a1:c1,transpose(d$1:d$3)) entered as array formula (CSE)
> drag the top formula to e2 and e3.
Rasoul Khoshravan - 15 Oct 2006 23:36 GMT
Is MMULT a built-in function or add-in one?
> Try selecting E1:E3, enter
> =MMULT($A$1:$C$3,$D$1:$D$3)
[quoted text clipped - 51 lines]
>> sumproduct(a1:c1,transpose(d$1:d$3)) entered as array formula (CSE)
>> drag the top formula to e2 and e3.
JMB - 16 Oct 2006 23:55 GMT
Seems to be built in (I'm using XL 2000 - wouldn't think they'd take it out
of subsequent versions, though).

> Is MMULT a built-in function or add-in one?
> > Try selecting E1:E3, enter
[quoted text clipped - 52 lines]
> >> sumproduct(a1:c1,transpose(d$1:d$3)) entered as array formula (CSE)
> >> drag the top formula to e2 and e3.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.