Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: How to optimize the multiplication of large matrices in Matlab?
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Clutch

Posts: 8
Registered: 2/19/12
How to optimize the multiplication of large matrices in Matlab?
Posted: Mar 8, 2013 8:16 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I have 2 matrices A, B, and vector C that I need to multiply. They are fairly large.

Matrix A = 10000x10000

Matrix B = 10000x10000

Vector C = 10000x1

If I perform A*B*C, this takes a long time so I used sparse function which collapses the matrices/vectors by removing large number of zeros then I convert it back to a full matrix.

full(sparse(A)*sparse(B)*sparse(C))

It's faster but I was wondering if there are more efficient techniques for multiplying them together. Would it be better to write for loops?

Secondly, some of the elements in my matrix have values close to zero so I can replace these with zeroes before converting them to sparse matrices. What's the best way to do this?



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.