Sort rowsπŸ”—

Sorts matrices and tables according to a key.

InputsπŸ”—

  • inputX: A matrix or table to be sorted. X ranges from 0 to dynamicInputCount - 1. The number of rows in each input matrix must be divisible by the number of rows in the key column. If N is the number of rows in an input matrix and M is the number of rows in the key column with N = k * M, then the sorting is applied to blocks of k rows.

  • keyColumn: The (zero-based) index of a sort key in input0. All output matrices, including input0, will be sorted based on values on this column.

  • order: Sorting order.

  • algorithm: Sorting algorithm.

  • locale: The locale used for string sorting. The β€œC” locale commonly used in programming is identical to β€œen_US”. An empty value means the locale will be automatically chosen based on the settings of the user’s operating system.

  • numeric: If true, the string sorting algorithm will place β€œ99” before β€œ100”. Otherwise, numbers are treated as characters.

  • ignorePunctuation: If true, punctuation characters and symbols are ignored when determining sort order. Otherwise, they are treated as sortable characters. If false, the behavior depends on locale.

OutputsπŸ”—

  • permutation: A matrix that stores the original index of each row in the input matrix.

  • outputX: A matrix or table that contains the rows received in inputX, sorted according to values of the key column.

Locale codesπŸ”—

If you need to manually craft a locale code, the format is β€œlanguage[_script][_country]”, where:

  • language is a lowercase, two-letter, ISO 639 language code (also some three-letter codes),

  • script is a titlecase, four-letter, ISO 15924 script code,

  • country is an uppercase, two-letter, ISO 3166 country code (also β€œ419” as defined by United Nations), and codeset and modifier are ignored.

enum OrderπŸ”—

Sorting order.

Values:

enumerator AscendingπŸ”—
enumerator DescendingπŸ”—
enum AlgorithmπŸ”—

Sorting algorithm.

Values:

enumerator NumericSortπŸ”—
enumerator StringSortπŸ”—