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

1 次查看(过去 30 天)
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

回答(1 个)

dpb
dpb 2019-11-7
NtoFind=5;
[Mn,iMn]=mink(X,NtoFind);
  4 个评论
iB
iB 2019-11-11
I thik my matlab virsion is the problem, mine is R2015a. That is why 'mink' is not working.
dpb
dpb 2019-11-11
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

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Shifting and Sorting Matrices 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by