Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 82
Default Matrix multiplication using sumproduct

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$B!!(B(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.


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 82
Default Matrix multiplication using sumproduct

Is MMULT a built-in function or add-in one?
"JMB" wrote in message
...
Try selecting E1:E3, enter
=MMULT($A$1:$C$3,$D$1:$D$3)
confirmed w/CSE


"Rasoul Khoshravan" wrote:

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.




  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default Matrix multiplication using sumproduct

Try selecting E1:E3, enter
=MMULT($A$1:$C$3,$D$1:$D$3)
confirmed w/CSE


"Rasoul Khoshravan" wrote:

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.



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default Matrix multiplication using sumproduct

Seems to be built in (I'm using XL 2000 - wouldn't think they'd take it out
of subsequent versions, though).


"Rasoul Khoshravan" wrote:

Is MMULT a built-in function or add-in one?
"JMB" wrote in message
...
Try selecting E1:E3, enter
=MMULT($A$1:$C$3,$D$1:$D$3)
confirmed w/CSE


"Rasoul Khoshravan" wrote:

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.





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Matrix Problem Jeff Excel Discussion (Misc queries) 1 February 4th 06 07:36 PM
Matrix Multiplication Jeff Excel Discussion (Misc queries) 1 January 18th 06 08:15 PM
Matrix Multiplication Matrix Bill Excel Worksheet Functions 1 October 6th 05 06:53 PM
matrix multiplication Carine Excel Worksheet Functions 4 July 6th 05 08:06 PM
Matrix multiplication with empty cells Ingrid Voigt Excel Worksheet Functions 2 March 8th 05 03:47 AM


All times are GMT +1. The time now is 04:32 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"