Mathematica Question (Matrix Multiplication)

In summary, the conversation is about a method for computing a product of matrices using Mathematica. The problem is that the product command in Mathematica only multiplies matrices element-wise, but the desired outcome is a matrix multiplication. The solution is to use the dot product command or the MatrixPower command.
  • #1
jeffreydk
135
0
I am trying to compute the following,

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

where [itex]\hat{I}, \hat{M(j)}[/itex] 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.
 
Mathematics news on Phys.org
  • #2
Use a . to multiply matrices: A.B
 
  • #3
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
The command MatrixPower[m,n] is what you're looking for!
 
  • #5
Ahh, thank you very much.
 

1. What is matrix multiplication?

Matrix multiplication is a mathematical operation where two matrices are multiplied together to create a new matrix. It is denoted by the symbol "x" or by placing the matrices next to each other. For example, if A and B are two matrices, then A x B represents the matrix multiplication operation.

2. How is matrix multiplication different from regular multiplication?

Matrix multiplication is different from regular multiplication in that it follows a specific set of rules and involves multiplying individual elements in the matrices, rather than just multiplying two numbers. In regular multiplication, the order of the numbers being multiplied does not matter, but in matrix multiplication, the order of the matrices does matter.

3. What are the properties of matrix multiplication?

Matrix multiplication has the following properties: it is associative, meaning (A x B) x C = A x (B x C); it is distributive, meaning A x (B + C) = A x B + A x C; and it is not commutative, meaning A x B does not always equal B x A. It also follows the scalar multiplication rule, where a constant multiplied by a matrix is equal to each element in the matrix being multiplied by that constant.

4. How is matrix multiplication used in real-world applications?

Matrix multiplication has many real-world applications, including in computer graphics, where it is used to transform 2D and 3D objects; in economics, where it is used to model supply and demand; and in statistics, where it is used to analyze data and make predictions. It is also used in physics, engineering, and many other fields.

5. Can any two matrices be multiplied together?

No, not all matrices can be multiplied together. For matrix multiplication to be possible, the number of columns in the first matrix must be equal to the number of rows in the second matrix. This means that for a matrix A with dimensions m x n, and a matrix B with dimensions n x p, the number of columns in A (n) must be equal to the number of rows in B (also n). If this condition is not met, then the matrices cannot be multiplied together.

Similar threads

Replies
15
Views
1K
Replies
6
Views
1K
Replies
1
Views
759
  • General Math
Replies
4
Views
956
Replies
1
Views
901
  • Calculus and Beyond Homework Help
Replies
20
Views
453
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
Replies
3
Views
1K
  • Introductory Physics Homework Help
Replies
12
Views
196
  • Engineering and Comp Sci Homework Help
Replies
2
Views
5K
Back
Top