<< CL_locationInfo Utilities CL_norm >>

CelestLab >> Utilities > CL_matSort

CL_matSort

Matrix sorting by row or column

Calling Sequence

[B] = CL_matSort(A,num [,option,direction]);

Description

Parameters

A:

Matrix (PxN)

num:

Row or column number (1 x 1)

option:

(string,optional) Indicates if num is a column number ('c') or row number ('r') Default is 'c'

direction:

(string,optional) Sorting order: 'i' = increasing, 'd' = decreasing

B:

Sorted matrix (PxN)

Authors

Examples

A=[1,3,2;1000,1010,1020;10,80,15];
// Sorts 2nd column increasingly, other columns sorted accordingly
[B] = CL_matSort(A,2);

// Sorts 3rd row decreasingly, other rows sorted accordingly
[B] = CL_matSort(A,3,'r','d');
<< CL_locationInfo Utilities CL_norm >>