Comparing numbers in columns then summing the percentages

1 view (last 30 days)
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

Accepted Answer

the cyclist
the cyclist on 8 Oct 2015
If A is your array ...
mean(A(:,6)>A(:,7))

More Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!