MATLAB: Sum all the Channels in matrix

MATLABmatrix operiationmerge the channelssummationwithout loops.

Hello everyone,
Let say I have a matrix M of 100 x 100 x 5. How can I sum all the channels of M and get one matrix R of size 100 x 100 only. I want to do it without loops.

Best Answer

R = sum(M,3);