sum slices of 3-d matrix
1 次查看(过去 30 天)
显示 更早的评论
Hello, I have a 3-d matrix A(n,m,k) and I would like to sum each others, the slices A(n,m) such that the output is the new matrix B(n,m) = A(n,m,1) + A(n,m,2) + ... + A(n,m,k)
the matrix could be quite huge; so if you could suggest a solution which use the parallel computing toolbox / gpu it would be really useful.
Thank you Best regards, P
0 个评论
采纳的回答
Walter Roberson
2018-3-24
B = sum(A, 3)
For large matrices MATLAB will automatically invoke a high performance multithreaded library to do the calculation. You would not be able to get high performance by using the Parallel Computing toolbox.
1 个评论
Joss Knight
2018-3-25
Well...maybe not using a parallel pool, but for a large matrix it should run faster on the GPU.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 GPU Computing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!