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

조회 수: 1 (최근 30일)
iB
iB 2019년 11월 7일
댓글: dpb 2019년 11월 11일
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