Calculate the minimum value of a sorted array.
var minsorted = require( '@stdlib/stats/array/minsorted' );Computes the minimum value of a sorted array.
var x = [ 1.0, 2.0, 3.0 ];
var v = minsorted( x );
// returns 1.0
x = [ 3.0, 2.0, 1.0 ];
v = minsorted( x );
// returns 1.0The function has the following parameters:
- x: input array.
- If provided an empty array, the function returns
NaN. - The function supports array-like objects having getter and setter accessors for array element access (e.g.,
@stdlib/array/base/accessor).
var linspace = require( '@stdlib/array/base/linspace' );
var minsorted = require( '@stdlib/stats/array/minsorted' );
var x = linspace( -50.0, 50.0, 10 );
console.log( x );
var v = minsorted( x );
console.log( v );