# Mathematica Question (Matrix Multiplication)

1. Jul 8, 2009

### jeffreydk

I am trying to compute the following,

$$\prod_{j=0}^{N-1}\left[\hat{I}+\hat{M(j)}\left(\frac{T}{N}\right)\right]$$

where $\hat{I}, \hat{M(j)}$ are matrices. My problem is that Mathematica interprets this product as element-wise with respect to the matrices, but I of course want it to use matrix multiplication. Is there any simple way to do this or do I need to write a code using some kind of do-loop?

Thanks for any help, I appreciate it.

2. Jul 8, 2009

### Moo Of Doom

Use a . to multiply matrices: A.B

3. Jul 8, 2009

### jeffreydk

I figured it out now using a Do[] command, but my point was that if you want to multiply many matrices and not write out the long stretch of A1.A2.A3.A4....AN, then you cannot use the product command on Mathematica because that will just multiply the matrices element-wise. I wanted to know if there was any way of using the product command for a dot product.

4. Jul 8, 2009

### Civilized

The command MatrixPower[m,n] is what you're looking for!

5. Jul 9, 2009

### jeffreydk

Ahh, thank you very much.