logical indexing for row-wise average
显示 更早的评论
How can I get a row-wise mean of this matrix
1 2 3
A = 4 5 6
7 8 9
but I only want to select these entries
0 1 1
B = 1 1 0
1 0 1
so the result would be something like
2.5
C = 4.5
8.0
Actually, this is easily possible with a loop, but I'd prefer a 1-line code. (this one is just a question of beauty :-))
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!