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 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!