Mean of specific rows from one column

13 visualizaciones (últimos 30 días)
Khayroon Suleyman
Khayroon Suleyman el 8 de Dic. de 2019
Editada: dpb el 8 de Dic. de 2019
Hi,
I want to find the mean of specific rows from one column, for example if I want to find the mean of rows 1, 3, 5, 6 and 7. How do I do this? I have attached an image of what this column looks like.
Thank you.
  1 comentario
dpb
dpb el 8 de Dic. de 2019
Editada: dpb el 8 de Dic. de 2019
mn=mean(x([1 3 5:7],n)); % where n is column number and x the array
Adjust syntax appropriately if x is in a table or struct or cell or whatever...
Don't attach images as files; use the picture icon so can see.
Better yet, attach a (smallish) sample of the data as text so folks can do something with it...

Iniciar sesión para comentar.

Respuesta aceptada

Inso
Inso el 8 de Dic. de 2019
This might work: mean(A([1, 3, 5, 6:7]))

Más respuestas (0)

Categorías

Más información sobre Cell Arrays 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