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

7 visualizaciones (últimos 30 días)
Marianne Auvinen
Marianne Auvinen el 17 de Sept. de 2019
Comentada: Marianne Auvinen el 18 de Sept. de 2019
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 comentarios
James Tursa
James Tursa el 17 de Sept. de 2019
Did you inadvertently shadow the mean( ) function?

Iniciar sesión para comentar.

Respuestas (1)

madhan ravi
madhan ravi el 17 de Sept. de 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
>>

Categorías

Más información sobre NaNs en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by