Calculating mean over multiple dimensions
조회 수: 29 (최근 30일)
이전 댓글 표시
I have a 3-dimensional variable that is of the class double, example: data has 50x2000x999. I would like to compute the mean for the 3rd dimension first, then the second dimension, and then the first dimension.
I know one way to do this is:
meandata = mean(data,3)
meandata = mean(meandata,2)
meandata = mean(meandata).
Is there a more efficient way to do this? In one line of code probably?
Thanks,
Akul
댓글 수: 0
답변 (1개)
madhan ravi
2019년 2월 17일
편집: madhan ravi
2019년 2월 17일
mean(data,'all') % or
mean(data,[3 2 1])
댓글 수: 1
참고 항목
카테고리
Help Center 및 File Exchange에서 Test Model Components에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!