How do i find the location by using max and find function?
이전 댓글 표시
I have a Matrix
K = [Mon Tue Wed Thu Fri Sat Sun]
L = [1 9 6 5 4 7 3 ;
3 5 6 4 1 8 2]
M = [K; L]
Finding the location that contain the maximum value. For example: 9 is the maximum value in this case and the column that contains it is Tue. So, how do we indicate the name of the column contain the maximum value?
Thank you!
채택된 답변
추가 답변 (1개)
madhan ravi
2020년 9월 15일
doc max % second output , does what you need
댓글 수: 3
Samantha Pham
2020년 9월 15일
madhan ravi
2020년 9월 15일
“How do i correct this?”
If it were me I would provide a valid example so that the person answering the question won’t have any trouble. Did you paste the K in command window and see what MATLAB has to say?
Samantha Pham
2020년 9월 15일
카테고리
도움말 센터 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
