Create an imat_ctrace object.
t=imat_ctrace
t=imat_ctrace(node,dir)
t=imat_ctrace( [node dir] )
t=imat_ctrace( {'coord1','coord2',...} )
t=imat_ctrace('coord1','coord2',...)
t=imat_ctrace(s)
The IMAT coordinate trace constructor function, creates a coordinate trace object from different types of input. An imat_ctrace has several attributes. These are the coordinate list ('Id'), the name ('Name'), a description of the coordinate trace ('Description'), and the coordinate trace internal structure version number ('Version'). The version number is intended for internal use only and should not be modified. See the imat_ctrace/get function for more information about the imat_ctrace attributes.
The first form, calling imat_ctrace with no arguments creates an empty coordinate trace.
The second form takes an nx1 numeric array of node numbers (node) and an nx1 cell array of strings (dir) containing the coordinate direction strings. One coordinate is created for each row of node and dir.
Alternatively, dir may be a numeric array containing numeric direction codes from the following table:
Numeric Code | Direction | Numeric Code | Direction |
1 | X+ | -1 | X- |
2 | Y+ | -2 | Y- |
3 | Z+ | -3 | Z- |
4 | RX+ | -4 | RX- |
5 | RY+ |
-5 |
RY- |
6 | RZ+ | -6 | RZ- |
0 | <null> |
The third form takes a single nx2 numeric array argument. The first column contains node numbers, and the second column contains numeric direction codes from the above table.
The fourth form takes a cell array of strings (either row or column orientation is OK). Each string should be a valid coordinate (i.e., node number followed by a direction string).
The fifth form allows individual coordinate strings to be provided directly to the constructor function.
The final form allows you to pass in a structure. The field names should either match imat_ctrace attribute names, or the structure should be in the form of the imat_ctrace internal structure (i.e. what you get from struct(t)). This form is useful, for example, if you extracted a structure using imat_ctrace/get and wanted to turn it back into an imat_ctrace.
>> t=imat_ctrace('5y',
'6rx', '3z', '4x-') % Fifth syntax
t =
'5Y+'
'6RX+'
'3Z+'
'4X-'
>> x=double(t) % Gets nx2 numeric representation
x =
5 2
6 4
3 3
4 -1
>> y=sort(x) % Don't ask me why we would want to do this!
y =
3 -1
4 2
5 3
6 4
>> t2=imat_ctrace(y) % Syntax #3
t2 =
'3X-'
'4Y+'
'5Z+'
'6RX+'
>>