How to find 4 minimum values from an array?

조회 수: 5 (최근 30일)
Sivakumaran Chandrasekaran
Sivakumaran Chandrasekaran 2014년 1월 22일
편집: Amit 2014년 1월 22일
Input array has 16 numbers.I need to find 4 least numbers from the given array. using 'min' command will get you a single answer only. What technique can be used to achieve the effective answer.

채택된 답변

Amit
Amit 2014년 1월 22일
편집: Amit 2014년 1월 22일
Lets say your array A (a mX1 and 1Xm) matrix (I am assuming). Then,
Y = sort(A);
val = Y(1:4);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by