Issortedrows
确定是否对矩阵或表行进行排序
Syntax
描述
tf =Issortedrows(
返回逻辑标量1(A
)真的
)当矩阵的第一列的元素A
按升序列出。否则,Issortedrows
返回0(false
). When the first column has consecutive repeated elements,Issortedrows
determines whether the next column is in ascending order, and repeats this behavior for succeeding equal values.
tf =Issortedrows(___,
当第一列的第一列返回1方向
)A
is in the order specified by方向
对于以前的任何语法。例如,Issortedrows(A,'monotonic')
checks if the first column ofA
处于上升或降序。方向
也可以是代表每列要检查的多个方向的字符阵列。例如,Issortedrows(A,[2 3],{'ascend' 'descend'})
checks if the second column ofA
按升序顺序,然后检查第三列是否按降序打破领带。
tf =Issortedrows(
检查表是否根据其行名称按顺序排列。表的行名称沿表的第一维标记行。tblA
,'RowNames')
当该语法不支持金宝apptblA
is a timetable.
tf =Issortedrows(
检查表的行是否由行标签排序tblA
,rowdimname
)rowdimname
along the first dimension.
If
tblA
是一个表,然后标签为行名。If
tblA
是时间表,然后the labels are row times.
tf =Issortedrows(___,
检查表是否按照指定的顺序排序方向
)方向
for any of the previous table syntaxes.方向
can be a single sort order such as“下降”
或者“单调”
, which is applied to each specified variable, row name, or row time.方向
can also be a cell array whose elements contain different sort orders for each specified variable, row name, or row time thatIssortedrows
operates on.