Getting mean() to return a vector
Show older comments
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
Answers (1)
KSSV
on 22 Apr 2017
2 votes
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.
Categories
Find more on Logical in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!