3d matrix multiplication with reduce computation time
Show older comments
Hello Everyone
I have two 3D-matrices A(M,N,I) and B(M,N,I) with complex numbers. Values of M,N and I are large say in the range 500-5000. An easy way to do matrix multiplication is to use for loop for I, but it hugely slows down my rest of the code because I have to do this multiplication thousand of time.
I have been searching the answer in MATLAB answer since two days. The recommended solutions are using following MEX files
3. ' mtimesx ': This is the only solution I found which fits for my situation. It's really fast with real numbers but when I use the complex number the estimated time is greater than simply using for loop.
Can anyone here please recommend the solution in which I can do multiplication of two complex 3D-matrices without using the for the loop but reduces computation time?
I am really looking for a positive response.
Regards abi
3 Comments
James Tursa
on 28 Aug 2017
Edited: James Tursa
on 28 Aug 2017
Can you post the m-code equivalent of what you are doing and the exact sized involved? Also, what MATLAB version and platform are you using? For the size ranges you mention above, the only speedup to be expected is likely to be the 2D slice copies that can be avoided in a mex routine, but maybe newer versions of MATLAB are smart enough to not make these copies.
Abi Waqas
on 29 Aug 2017
Jan
on 29 Aug 2017
Just a note: See the preceding question: https://www.mathworks.com/matlabcentral/answers/353797-can-i-reduce-computation-time-for-the-matrix-computation-sparse-matrices
Accepted Answer
More Answers (0)
Categories
Find more on Linear Algebra in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!