Find the highest value and its entry of a (2xn) matrix in each column

Hello,
I have a matrix with the size of 2xn , lets fill it with random numbers:
17 23 4 10 11
24 5 6 12 18
Now I want to know the entry number of the highest value in each row (in form of a vector, 1xn) and a vector full of the values themselfes (size 1xn), which would mean for the example:
2 1 2 2 2
and
24 23 6 12 18
I have to do that for a lot of iterations build into a GUI, so I want to fasten it a bit up and stop using a for loop with if cases. Same values in both entries is mathimatically impossible.
Could someone please help me with that?
PS: The programm needs to run on Matlab version since 2013

 Respuesta aceptada

Más respuestas (0)

Categorías

Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.

Productos

Preguntada:

el 25 de Jun. de 2015

Comentada:

el 25 de Jun. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by