duration

Methods

Method Reference: duration.mink

duration: B = mink (A, K)
duration: B = mink (A, K, dim)
duration: [B, index] = mink (A, …)

Find the smallest elements in a duration array.

B = mink (A, K) returns the K smallest elements of the duration array A in ascending order. If A is a vector, then B is a vector with K elements. If A is a matrix, then mink operates along each column of A and B has K rows. For multidimensional arrays, mink operates along the first non-singleton dimension.

B = mink (A, K, dim) operates along the dimension specified by dim.

K must be a nonnegative integer scalar. If K is larger than the number of elements along the operating dimension, then all of them are returned. Inf and -Inf are ranked as ordinary values.

Missing elements (NaN) are not ranked. They are appended after the ranked elements in their original order, and hence they only appear in B when K exceeds the number of non-missing elements along the operating dimension. Unlike sort, mink has no 'MissingPlacement' option, since NaN elements are always placed last. Elements comparing as equal keep their original order.

[B, index] = mink (A, …) also returns an index array containing the indices of the returned elements of A along the operating dimension.

Source Code: duration