<< ismissing | Data analysis | max >> |
tf = issorted(A) |
tf = issorted(A, dim) |
tf = issorted(..., direction) |
tf = issorted(A, 'rows') |
an nelson's variable (double, single, int8, int16, int32, int64, uint8, uint16, uint32, uint64, logical, char, string, cell).
Dimension to operate along: positive integer scalar.
Sorting direction: 'ascend' (default) or 'descend'.
returns true when the elements of the first column of a matrix are sorted.
a logical: true if array is sorted.
tf = issorted(A) returns true if the elements of A are sorted in ascending order, and false otherwise.
x = [1 2 3 4];
issorted(x) % returns true
x = [1 3 2 4];
issorted(x) % returns false
% Check if a matrix is sorted by rows
A = [1 2 3; 4 5 6; 7 8 9];
issorted(A, 'rows') % returns true
A = [1 2 3; 7 8 9; 4 5 6];
issorted(A, 'rows') % returns false
sort.
Version | Description |
---|---|
1.0.0 | initial version |
Allan CORNET