Message Boards Message Boards

1 Reply
0 Total Likes
View groups...
Share this post:

How to multiply several matrices?

Posted 10 years ago
The code Sum[(Cos)^2 - (Cos)^2, {i, 1, n}] provides one with a sum from 1 to n. Similarly, Product[] gives a sum from 1 to n.

I would be interested in a similar command for a product of n matrices; I have to specify that I really wanna use the Dot multiplication, not the componentwise one. And n is not specified, so I am exactly in the same situation as for Sum and Product.

Does anybody know how to do this?

Many thanks in advance!
POSTED BY: abdelalj
 In[2]:= mat[n_] := {{n, n + 1}, {n + 2, n + 3}}
 In[8]:= mat[1].mat[2].mat[3]
 Out[8]= {{95, 118}, {211, 262}}
 In[9]:= Dot[Sequence @@ Table[mat[i], {i, 3}]]
 Out[9]= {{95, 118}, {211, 262}}
POSTED BY: Frank Kampas
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract