How to sum 3D matrix along 2 and 3 dimention

22 vues (au cours des 30 derniers jours)
Ole
Ole le 8 Juil 2022
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);

Réponse acceptée

Stephen23
Stephen23 le 8 Juil 2022
B = ones(20,10,10);
V = sum(B,2:3)
V = 20×1
100 100 100 100 100 100 100 100 100 100

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Tags

Produits


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by