<< CL_man_sma DEPRECATED CL_mod_equinoxesEquation >>

CelestLab >> DEPRECATED > CL_matSort

CL_matSort

Matrix sorting by row or column - DEPRECATED

Calling Sequence

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

Description

Parameters

A:

Matrix (PxN)

num:

Row or column number (1x1)

option:

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

direction:

(string, optional) Sorting order: 'i' = increasing, 'd' = decreasing (1x1). Default is 'i' (1x1)

B:

Sorted matrix (PxN)

I:

Index such that A(:,I) = B if option='r' or A(I,:) = B if option='c' (1xN or Px1)

Authors

Examples

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

// Sorts 3rd row decreasingly, other rows sorted accordingly
[B,I] = CL_matSort(A,3,'r','d');
A(:,I) - B;  // == 0

Report an issue
<< CL_man_sma DEPRECATED CL_mod_equinoxesEquation >>