using maxk with named columns

22 Ansichten (letzte 30 Tage)
Rick Huisman
Rick Huisman am 9 Okt. 2020
Kommentiert: Ameer Hamza am 9 Okt. 2020
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?

Akzeptierte Antwort

Ameer Hamza
Ameer Hamza am 9 Okt. 2020
Bearbeitet: Ameer Hamza am 9 Okt. 2020
If all the columns in the table are numeric
max_val = max(T{:,:})
Note maxk(x,1) is same as max(k).
  2 Kommentare
Rick Huisman
Rick Huisman am 9 Okt. 2020
Thank you :)
Ameer Hamza
Ameer Hamza am 9 Okt. 2020
I am glad to be of help!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Descriptive Statistics finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by