How to calculate the mean of each row from several columns?

6 次查看(过去 30 天)
I have 3 columns as three separate variables in the workspace. I want to find the mean of each row to create a new column of averaged values.

采纳的回答

Jan
Jan 2018-7-23
编辑:Jan 2018-7-23
a = rand(10, 1);
b = rand(10, 1);
c = rand(10, 1);
m = (a + b + c) / 3
Or less efficient:
m = mean([a, b, c], 2)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Dates and Time 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by