imat_shp/sort


Purpose

Sort an imat_shp by frequency.

Syntax

t=sort(s)
[t,ind]=sort(s)

Description

SORT will sort an imat_shp object by frequency. ind is an optional second output argument containing an index vector such that t=s(ind).

Example

>> s=imat_shp(3,'shape',reshape(1:18,6,3),'frequency',[103 101 102])

s =

3x1 IMAT Shape with the following attributes:

Row Frequency           Damping             NumberNodes
--- ------------------- ------------------- -------------------
1   103                 0                   2
2   101                 0                   2
3   102                 0                   2

>> [t,ind]=sort(s)
t =

3x1 IMAT Shape with the following attributes:

Row Frequency           Damping             NumberNodes
--- ------------------- ------------------- -------------------
1   101                 0                   2
2   102                 0                   2
3   103                 0                   2


ind =
       2
       3
       1

>>