using maxk with named columns

조회 수: 3 (최근 30일)
Rick Huisman
Rick Huisman 2020년 10월 9일
댓글: Ameer Hamza 2020년 10월 9일
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?

채택된 답변

Ameer Hamza
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
Rick Huisman
Rick Huisman 2020년 10월 9일
Thank you :)
Ameer Hamza
Ameer Hamza 2020년 10월 9일
I am glad to be of help!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by