Set one or more attributes of an imat_result object.
set(r)
r1=set(r,'attrib1',value1,'attrib2',value2,...)
r1=set(r,v)
The SET function allows you to change any attribute of an imat_result variable.
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 r is not referenced, but simply causes MATLAB to call the SET function associated with imat_result objects.)
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 second argument is a numeric vector of indices into r.
The attribute names can be any valid attribute for the imat_result object. Attribute values can either be a single value (in which case the value is used to set all elements of r), or an array of values dimensioned the same size as r. A cell array of strings should be used to set string or list attributes.
The attributes are set in the order listed. Note that setting some attributes will cause side effects:
An alternative way to set attributes is with the syntax r.attrib=value.
>> r=imat_result(2);
>> r=set(r,'Name',{'Name 1','Name 2'},'modeltype','structural')
r =
2x1 IMAT_RESULT
Row Name DataLocation ModelType ResultType
--- ------ ------------- ---------- ------------
1 Name 1 Data at nodes Structural User defined
2 Name 2 Data at nodes Structural User defined
>> r(1)=set(r(1),'resulttype','displacement');
>> r=set(r,1:2,'data',ones(10,2))
r =
2x1 IMAT_RESULT
Row Name DataLocation ModelType ResultType
--- ------ ------------- ---------- ------------
1 Name 1 Data at nodes Structural Displacement
2 Name 2 Data at nodes Structural User defined
>>