using maxk with named columns
조회 수: 3 (최근 30일)
이전 댓글 표시
I want to locate the maximum number in a matrix.
For instance
A = magic(5)
to show the highest value I use maxk(A,1)
when I assign variable names to the table, maxk doesnt work, probably because there are now also names in the table.
How do I get this to work?
댓글 수: 0
채택된 답변
Ameer Hamza
2020년 10월 9일
편집: Ameer Hamza
2020년 10월 9일
If all the columns in the table are numeric
max_val = max(T{:,:})
Note maxk(x,1) is same as max(k).
댓글 수: 2
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Descriptive Statistics에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!