Find the highest value and its entry of a (2xn) matrix in each column
Ältere Kommentare anzeigen
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
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!