How to sum 3D matrix along 2 and 3 dimention

조회 수: 9 (최근 30일)
Ole
Ole 2022년 7월 8일
답변: Stephen23 2022년 7월 8일
There is 20x10x10 matrix how to sum all elements in the 2D slices along the 20 elements.
The end result should be 20x1 vector
B = ones(20,10,10);

채택된 답변

Stephen23
Stephen23 2022년 7월 8일
B = ones(20,10,10);
V = sum(B,2:3)
V = 20×1
100 100 100 100 100 100 100 100 100 100

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Interpolation에 대해 자세히 알아보기

태그

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by