issortedrows
Determine whether matrix rows are sorted.
📝Syntax
tf = issortedrows(A)
tf = issortedrows(A, col)
tf = issortedrows(A, ..., direction)
📥Input Arguments
Parameter Description
A a matrix.
col the columns used for the comparison.
direction 'ascend' (default) or 'descend'.
📤Output Arguments
Parameter Description
tf a logical: true when the rows of A are sorted.
📄Description

tf = issortedrows(A) returns true when the rows of A are sorted in ascending order.

Pass col and direction to match the sorting used by sortrows.

💡Examples
issortedrows([1 2; 3 4])
🔗See Also
sortrowstopkrows
🕔Version History
Version Description
2.0.0 initial version
Edit this page on GitHub