Borrar filtros
Borrar filtros

What is the fastes way to find the maximum of a set of data?

3 visualizaciones (últimos 30 días)
It would be easy to use a for loop and compare element by element, but I dont think that is the best way to do it. Does matlab have a function for this? Or would it be better to write my own sorting algorithm

Respuesta aceptada

Image Analyst
Image Analyst el 4 de Sept. de 2013
Well, the max() function springs to mind. Did you look up max in the help? If you want the data sorted, there is a sort() function, believe it or not.
  1 comentario
Chad
Chad el 4 de Sept. de 2013
Thanks for the quick reply. Looking back at my question I would rephrase it: "What exactly is the max() function doing?" I use it quite frequently. is it the fastest/most efficient way to find the max?

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Shifting and Sorting Matrices 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