Info
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
How to find which element is the lowest first or second or third or ....
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
There is a 1X1 matrix.
I wanna find which element is the MINIMUM not the minimum value but the number of the particular element.
If this is the matrix,
y = [682.8333 399.8160 34.2270 46.1800 107.7035 ];
I know the minimum value is 34.2270 to get that we can use
mini= min(y);
but what i want is how to get the number of the minimum element
in here it's the 3rd element.
Thank you.
0 comentarios
Respuestas (1)
Star Strider
el 5 de Mzo. de 2015
Use the min function with two outputs:
[mini,index] = min(y);
The second output, ‘index’ here, is the index of the first minimum value the function finds.
2 comentarios
Star Strider
el 5 de Mzo. de 2015
My pleasure!
If it solved your problem, I would appreciate it if you would Accept it.
La pregunta está cerrada.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!