@rowsort |

Matrix where each row contains sorted columns.

Syntax: @rowsort(m[, o])

m: matrix, vector

o: (optional) string

Return: matrix, vector

Returns a matrix where each row contains the sorted values of the corresponding row of m.

The option o controls the direction of the ranking: āaā (ascending - default) or ādā (descending).

Examples

Let M1 be a matrix. Then

= @rowsort(m1, "d")

returns a matrix whose i-th row is the sorted (from largest on the left to smallest on the right) version of the i-th row in M1.

Cross-references

See also
@capplyranks and
@rapplyranks.