How to find n number of low value's position or column number from a cell ?

1 visualización (últimos 30 días)
iB
iB el 7 de Nov. de 2019
Comentada: dpb el 11 de Nov. de 2019
I have cell sized 1x45, containing values like [0.22 0.12 0.001 0.01 ... ] now I want to find the column numbers of 5 or any no. of lowest values. Thank you

Respuestas (1)

dpb
dpb el 7 de Nov. de 2019
NtoFind=5;
[Mn,iMn]=mink(X,NtoFind);
  4 comentarios
iB
iB el 11 de Nov. de 2019
I thik my matlab virsion is the problem, mine is R2015a. That is why 'mink' is not working.
dpb
dpb el 11 de Nov. de 2019
Indeed, mink wasn't introduced until R2017b, I think...
The easiest coding way then is to use sort with the optional returned indices vector and select the first N

Iniciar sesión para comentar.

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