imat_result/sort


Purpose

Sort components for imat_result.

Syntax

sort(r)
sort(r,COLLIST)

[r,ind] = sort(r)

Description

SORT sorts the components and data in increasing ID order.

COLLIST is an optional numeric vector specifying the list of columns to use in the sort. The components will be sorted in the order specified in COLLIST. A negative column number will sort that column in descending order. The default is 1.

IND is an optional output cell array containing vectors of the sort order for each individual result. It is the same size as R.

Examples

>> d = imat_result_dan;
>> d = setComponents(d,[100 101],3:-1:1,0,true,1:6)

d =
Data At Nodes: Unknown
================================================
      Node       Dir      SEID              Data
------------------------------------------------
      100          3         0                 1
      100          2         0                 2
      100          1         0                 3
      101          3         0                 4
      101          2         0                 5
      101          1         0                 6
------------------------------------------------
Number of Values: 6 Number of Nodes: 2
================================================

>> sort(d)

ans =

Data At Nodes: Unknown
================================================
      Node       Dir      SEID              Data
------------------------------------------------
       100         3         0                 1
       100         2         0                 2
       100         1         0                 3
       101         3         0                 4
       101         2         0                 5
       101         1         0                 6
------------------------------------------------
Number of Values: 6 Number of Nodes: 2
================================================

>> sort(d,[1 2 3])

ans =

Data At Nodes: 3DOF global translation vector
================================================
      Node       Dir      SEID              Data
------------------------------------------------
       100         1         0                 3
       100         2         0                 2
       100         3         0                 1
       101         1         0                 6
       101         2         0                 5
       101         3         0                 4
------------------------------------------------
Number of Values: 6 Number of Nodes: 2
================================================

>>