Sort a coordinate trace.
[tsort,i]=sort(t)
When applied to an imat_ctrace object, the SORT function sorts a coordinate trace in order of node, then degree of freedom. The (optional) second output argument is an index array such that tsort=t(i).
Rotational degrees of freedom are sorted to follow the translational degrees of freedom. Repeated coordinates are not eliminated, but pluscoordinates sort before minus coordinates if the coordinates match in other respects.
>> t=imat_ctrace('5y', '3rx', '3z', '4x-', '3z-')
t =
'5Y+'
'3RX+'
'3Z+'
'4X-'
'3Z-'
>> sort(t)
ans =
'3Z+'
'3Z-'
'3RX+'
'4X-'
'5Y+'
>> [ts,i]=sort(t); i
i =
3
5
2
4
1
>>