using maxk with named columns

3 views (last 30 days)
Rick Huisman
Rick Huisman on 9 Oct 2020
Commented: Ameer Hamza on 9 Oct 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?

Accepted Answer

Ameer Hamza
Ameer Hamza on 9 Oct 2020
Edited: Ameer Hamza on 9 Oct 2020
If all the columns in the table are numeric
max_val = max(T{:,:})
Note maxk(x,1) is same as max(k).

More Answers (0)

Categories

Find more on Descriptive Statistics in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!