Adding layers of a boolean matrix
조회 수: 1 (최근 30일)
이전 댓글 표시
I have a series of 2400x2400x46 double matrices, all comprised of 0s and 1s. I would like to add all of the layers of each matrix then divide by the total number of layers (46). The result would be a 2400x2400x1 matrix (comprised of the sums of 0-46 divided by 46).
How might I go about doing this?
Thank you!
댓글 수: 0
채택된 답변
Walter Roberson
2012년 10월 14일
mean(YourMatrix, 3)
Works even if YourMatrix is of datatype logical instead of double
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Operating on Diagonal Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!