Getting mean() to return a vector
显示 更早的评论
I would like to get the mean of each row in nxn to be returned as a nx1 vector without looping. Is this possible?
Paul
回答(1 个)
KSSV
2017-4-22
2 个投票
doc mean
it has option of providing dim you want. Let A be your n*n data.
mean(A) computes the mean of each column. mean(A,2) computes the mean of each row.
类别
在 帮助中心 和 File Exchange 中查找有关 Logical 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!