the meaning of "[~," in a matrix
230 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
hamid
el 25 de Mzo. de 2016
Comentada: Star Strider
el 23 de Mzo. de 2023
Hi
my friend send to me a code that I don`t understand a line of it. The line is:
[~ , x_opt] = min(g); % g is the cost function vector
my question is that what is the meaning of "[~," in a matrix?
thanks
0 comentarios
Respuesta aceptada
Star Strider
el 25 de Mzo. de 2016
The tilde ‘~’ in a function output tells MATLAB to not import that output in the calling function workspace. The min function can produce two outputs, the minimum (the first output) and the index of the first instance of the minimum value for the second. In the code you quoted, whoever wrote it was only interested in the index.
6 comentarios
Más respuestas (0)
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!