how to add all 2d matrices in a 4D matrix???

3 views (last 30 days)
i have a matrix of 10*50*24*24
i want to add all 10*50 matrices??
any help???

Accepted Answer

Bruno Luong
Bruno Luong on 21 Aug 2019
sum(sum(A,3),4)
or
sum(A(:,:,:),3)

More Answers (2)

madhan ravi
madhan ravi on 21 Aug 2019
sum(matrix,[4,3]) % 2018b >=

James Tursa
James Tursa on 21 Aug 2019
sum(sum(your_matrix,4),3)
or
sum(reshape(your_matrix,10,50,[]),3)

Categories

Find more on Sequence and Numeric Feature Data Workflows in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!