Finding mean of row and column in a 3D matrix

2 views (last 30 days)
Hi, I have a matrix that is 40x20x905. I want to extract a matrix that is 1x1x905 which will have the mean value of the rows(15:25) and the mean value of the columns(5:15). Is this possible?
Lets say the signal is 'X'. And I am to extract:
a = X(mean of rows(15:25), mean(5:15) , :)
To get 'a' as:
a (1x1x905)
Is there a way to do this?

Accepted Answer

Matt J
Matt J on 26 Jan 2021
a = mean( X(15:25,5:15,:), [1,2])

More Answers (0)

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!