How can I take a mean of a matrix only from 10 first rows?

8 次查看(过去 30 天)
I have a 50000x3 matrix X and I would need to take column means taking only first 5000 rows into account.
mean_values = mean(X(1:5000, :)) only gives one mean value instead of giving mean values for each 3 columns.
What should I do?

回答(1 个)

madhan ravi
madhan ravi 2019-9-17
>> X = rand(50000,3); % are you sure it's a 50000 by 3 matrix?
>> mean(X(1:5000,:))
ans =
0.5028 0.5015 0.4978
>>

类别

Help CenterFile Exchange 中查找有关 NaNs 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by