sort
-
B = sort(A,<dim>,<dir>)将 A 中元素沿维数 dim 排列-
dir 指示排列方向, 可填
'ascend'或'descend', 默认为升序'ascend' -
dim 需为整数, 默认为第一个非 1 的维数
-
沿维数 dim 的意思是 (若为升序):
-
- 特例:
- If A is a vector, then
sort(A)sorts the vector elements - If A is a matrix, then
sort(A)treats the columns of A as vectors and sorts each column - if A is a matrix, then
sort(A,2)sorts the elements of each row
- If A is a vector, then