Comparing numbers in columns then summing the percentages

1 次查看(过去 30 天)
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