Borrar filtros
Borrar filtros

Comparing numbers in columns then summing the percentages

1 visualización (últimos 30 días)
Max
Max el 8 de Oct. de 2015
Editada: Max el 8 de Oct. de 2015
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

Respuesta aceptada

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

Más respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by