Matrix Manipulation Average of specific column

조회 수: 1 (최근 30일)
Brady Wayne Robinson
Brady Wayne Robinson 2018년 9월 27일
댓글: Brady Wayne Robinson 2018년 9월 27일
I have data in excel that is 17 columns by 4800 rows. I need to find all the numbers in each column separately that are greater then 10 and then find there average. This needs to be done for each 17 columns. Just unsure how to do this. Thank You!

답변 (1개)

the cyclist
the cyclist 2018년 9월 27일
편집: the cyclist 2018년 9월 27일
If A is the array with your values, then
A10 = (A > 10);
meanA = sum(A.*A10)./sum(A10)
  댓글 수: 5
the cyclist
the cyclist 2018년 9월 27일
I don't quite follow your explanation.
I suggest you ...
  • open up a new question
  • give a very small illustrative example (e.g. maybe just 4x3) what the input matrix looks like
  • explain what you expect for the output, and why
It's helpful if you define the input matrix in actual MATLAB code, and not just explain what it is like.
Brady Wayne Robinson
Brady Wayne Robinson 2018년 9월 27일
say I have an array A A=[10 20 3 5 6 4 7 10] We can see that the first and last columns both contain a number that is greater than or equal to 10. I need to know what row that happens in. Here it is easy because there is only one row, but I am dealing with 4800 rows. So I need to find the specific rows where the 6th column and the 8th column both are greater or equal to ten with in the same row. row 189 6th column=11 row 189 8th column=13 therefore row 189 would be a row I need to note. I need to find every row where this is true.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by