필터 지우기
필터 지우기

sum slices of 3-d matrix

조회 수: 3 (최근 30일)
Paolo
Paolo 2018년 3월 24일
댓글: Joss Knight 2018년 3월 25일
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

채택된 답변

Walter Roberson
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
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 CenterFile Exchange에서 GPU Computing에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by