How to sum 3D matrix along 2 and 3 dimention

33 次查看(过去 30 天)
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 中查找有关 Logical 的更多信息

标签

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by