[~,i]=max(y); what does it mean in matlab
38 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
can i know the meaning of this command "[~,i]=max(y);" in matlab??
0 comentarios
Respuestas (1)
Mark Sherstan
el 15 de Feb. de 2019
Editada: Mark Sherstan
el 15 de Feb. de 2019
The ~ represents an output that is discarded. It is essentially equivalent to:
[dummy,idx]=min(dists);
clear dummy
For this example, the code wants to work with the index of the minimum value, not the value itself, so the minimum value that is returned is discarded and only the index is retained.
0 comentarios
Ver también
Categorías
Más información sobre Multirate Signal Processing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!