between

Syntax

between(X, Y)

Arguments

X is a scalar/pair/vector/matrix.

Y is a pair indicating a range.

Details

Check if each element of X is between the pair indicated by Y (both boundaries are inclusive). The result is of the same dimension as X.

Examples

$ between([1, 5.5, 6, 8], 1:6);
[1,1,1,0]
// 1, 5.5 and 6 are between 1 and 6, but 8 is not.

$ between(1 2.4 3.6 2 3.9, 2.4:3.6);
[0,1,1,0,0]