필터 지우기
필터 지우기

Comparing numbers in columns then summing the percentages

조회 수: 1 (최근 30일)
Max
Max 2015년 10월 8일
편집: Max 2015년 10월 8일
I have been given a tab
2 4 2001 4 5 2 1
2 4 2001 9 6 4 7
2 4 2001 19 14 7 3
2 4 2001 25 21 5 4
2 4 2001 7 18 4 5
I have to found out what percentage of the 6th column is greater than the 7th column. i.e 2>1 7<4 7>3 5>4 4<5 meaning two numbers in column 6 than in column 7 meaning 50% of numbers in column 6 are larger. How would i go having code to show that 50% of numbers in column 6 are larger than in column 7 Also, for the future what would I do if some of the numbers in the columns were the same.Thanks

채택된 답변

the cyclist
the cyclist 2015년 10월 8일
If A is your array ...
mean(A(:,6)>A(:,7))

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by