Message Boards Message Boards

How to multiply several matrices?

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
3 years ago
 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
3 years ago

Group Abstract Group Abstract