How can I take a mean of a matrix only from 10 first rows?
7 views (last 30 days)
Show older comments
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?
3 Comments
Answers (1)
madhan ravi
on 17 Sep 2019
>> 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
>>
See Also
Categories
Find more on NaNs in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!