help with max function
Ältere Kommentare anzeigen
[Max,index]=max(array,[ ],2)..... Iam using this syntax to find the maximum value of every column but in case of two equal maximum values it returns the first one... how can I solve this?! Thanks
5 Kommentare
Walter Roberson
am 10 Feb. 2020
You have not defined what outcome you would prefer.
Steven Lord
am 10 Feb. 2020
That sounds like it's working as it should. From the documentation "If the largest element occurs more than once, then I contains the index to the first occurrence of the value."
What did you expect it to do instead?
Marco Nashaat
am 10 Feb. 2020
Mohymen Kushal
am 26 Okt. 2020
if A is a matrix, then max(A,[ ],2) is a column vector containing the maximum value of each row . What is this '2' for ? can anybody explain please. Thanks.
the cyclist
am 29 Okt. 2020
As clearly stated in the documentation for max, that "2" indicates the matrix dimension along which to take the maximum.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Geometry and Mesh finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!