# mean value of each row

342 views (last 30 days)

Show older comments

I have A 500 by 16 matrix and I want to find a mean value of each row and return the result as a 500 by 1.

Does anyone have an idea?

Thank you

##### 2 Comments

Walter Roberson
on 17 Jul 2018

### Accepted Answer

Walter Roberson
on 5 Feb 2012

mean(YourMatrix,2)

##### 4 Comments

Amy Gleckl
on 20 Dec 2019

I had a similar issue and this worked perfectly for me, thank you very much!

### More Answers (2)

sura Naji
on 25 Oct 2019

##### 1 Comment

Walter Roberson
on 22 Dec 2019

M = mean(amatrix);

S = std(amatrix);

[~, order] = max(abs(amatrix - M));

furthest_from_mean = amatrix(order(1));

Note that the value that is furthest from the mean will also be the value that is the greatest zscore (furthest deviation)

RAMPUNIT KUMAR
on 2 Sep 2021

##### 1 Comment

Walter Roberson
on 2 Sep 2021

syms a b c d e f g h I j k l m n o p q r

matrix = [a b c d e f g h I j k l m n o p q r]

means = (matrix(1:2:end) + matrix(2:2:end))/2

except that you would use the appropriate numeric values in matrix instead of syms . The syms used here is just for demonstration purposes.

### See Also

### Categories

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!