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

1 Ansicht (letzte 30 Tage)
M.Prasanna kumar
M.Prasanna kumar am 21 Aug. 2019
Kommentiert: M.Prasanna kumar am 21 Aug. 2019
i have a matrix of 10*50*24*24
i want to add all 10*50 matrices??
any help???

Akzeptierte Antwort

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

Weitere Antworten (2)

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

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

Kategorien

Mehr zu Sequence and Numeric Feature Data Workflows finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by