Mean of specific rows from one column

13 次查看(过去 30 天)
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 个评论
dpb
dpb 2019-12-8
编辑:dpb 2019-12-8
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...

请先登录,再进行评论。

采纳的回答

Inso
Inso 2019-12-8
This might work: mean(A([1, 3, 5, 6:7]))

更多回答(0 个)

类别

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

Community Treasure Hunt

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

Start Hunting!

Translated by