using maxk with named columns

2 visualizaciones (últimos 30 días)
Rick Huisman
Rick Huisman el 9 de Oct. de 2020
Comentada: Ameer Hamza el 9 de Oct. de 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?

Respuesta aceptada

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

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Descriptive Statistics en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by