Mean of specific rows from one column

조회 수: 35 (최근 30일)
Khayroon Suleyman
Khayroon Suleyman . 2019년 12월 8일
편집: dpb . 2019년 12월 8일
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 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 2019년 12월 8일
This might work: mean(A([1, 3, 5, 6:7]))

추가 답변 (0개)


Help CenterFile Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by