1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Mathematica Question (Matrix Multiplication)

  1. Jul 8, 2009 #1
    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.
     
  2. jcsd
  3. Jul 8, 2009 #2
    Use a . to multiply matrices: A.B
     
  4. Jul 8, 2009 #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.
     
  5. Jul 8, 2009 #4
    The command MatrixPower[m,n] is what you're looking for!
     
  6. Jul 9, 2009 #5
    Ahh, thank you very much.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Mathematica Question (Matrix Multiplication)
  1. Matrix Multiplication (Replies: 2)

  2. Matrix multiplication (Replies: 1)

  3. Matrix Multiplication (Replies: 5)

Loading...