sort!

Syntax

sort!(X, [ascending=true])

Arguments

X is a vector.

ascending (optional) is a Boolean scalar indicating whether to sort X in ascending order or descending order. The default value is true (ascending order).

Details

Sort X in-place in ascending/descending order.

Examples

x=9 1 5;
sort!(x);
x;
// output
[1 5 9]

x.sort!(0);
x;
// output
[9,5,1]