Set one or more attributes of an imat_ctrace object.
set(t)
v=set(t,'Attrib1',value1,'Attrib2',value2,...)
t(1:2)=set(t(1:2),'attrib1',value1,...)
u=set(t,v)
The SET function allows you to change any attribute of an imat_ctrace object.
If SET is called with no attribute arguments, then all attribute names and their possible values are printed to standard output. This functionality acts as a built-in help mechanism for data attributes. (Note that in this case, the argument t is not referenced, but simply causes MATLAB to call the SET function associated with imat_ctrace objects.)
If the reference to the input variable t includes subscripts, you must assign the output from SET as in the 3rd example above, otherwise MATLAB will issue an error.
To change attribute values, you must either supply pairs of attribute names and values (syntax 2), or you must supply a scalar structure variable (like the one returned by get) whose field names are the attribute names to be changed, and whose field values are the desired values (syntax 3).
The attribute names can be any valid attribute for the imat_ctrace object. Attribute values must be a single value, since an imat_ctrace object is not multidimensional (the coordinates are stored as a single nx5 double matrix in the object). This is consistent with the values returned by the get function.
The attributes are set in the order listed. If the same attribute is set more than once using SET, only the last applied change will hold.
An alternative way to set attributes is with the syntax t.attrib=value.
>> t=imat_ctrace('1x','2x','3y')
t =
'1X+'
'2X+'
'3Y+'
>> set(t)
Id: [ nx5 double ]
Name: [ string ]
Description: [ string ]
Version: [ integer value ]
>> u=set(t,'name','Copied ctrace')
Copied ctrace
u =
'1X+'
'2X+'
'3Y+'
>> v=get(t)
v =
Id: [3x5 double]
Name: ''
Description: ''
Version: 2
>> v.Name='New name';
>> set(t,v); t
New name
t =
'1X+'
'2X+'
'3Y+'
>>