How to find 4 minimum values from an array?

9 次查看(过去 30 天)
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 中查找有关 Logical 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by