Matrix rows or columns sorting
[mat2,I] = CL_sortMat(mat,u [,direction]);
Sorts the rows or columns of a matrix according to the sorting order of a vector.
- If u is a column vector, the rows of mat will be sorted in the same order as the rows of u.
- If u is a row vector, the columns of mat will be sorted in the same order as the columns of u.
The sorting order is determined by direction (increasing by default).
Matrix (PxN)
Row or column vector (1xN or Px1)
(string, optional) Sorting order: "i" = increasing, "d" = decreasing. Default is "i" (1x1)
Sorted matrix (PxN)
Sorting index (u_sorted = u(I)) (1xN or Px1)
CNES - DCT/SB