help with max function
이전 댓글 표시
[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
Walter Roberson
2020년 2월 10일
You have not defined what outcome you would prefer.
Steven Lord
2020년 2월 10일
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
2020년 2월 10일
Mohymen Kushal
2020년 10월 26일
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
2020년 10월 29일
As clearly stated in the documentation for max, that "2" indicates the matrix dimension along which to take the maximum.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Geometry and Mesh에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!