Truncate an imat_fn ito the specified abscissa range.
g=truncate(f,[1.5 2.5])
g=truncate(f,[1.5 2.5],'keep')
g=truncate(f,[2 5],'remove')
g=truncate(f,[1 3 6 7],'keep','index','resetstart')
TRUNCATE will truncate the supplied imat_fn based on the specified abscissa range. F is an imat_fn. The second input is a vector containing the abscissa range or indices to keep or remove. If it is a 1x2 vector, then TRUNCATE treats the values as a range. Otherwise it assumes they are discrete values. If they are discrete abscissa values, TRUNCATE will select the closest actual abscissa value to the specified value.
Two optional input arguments are supported. The first specifies what to do with the supplied abscissa values. If set to 'keep' (the default), TRUNCATE will keep all data values that lie between the two abscissa values specified in the range. If set to 'remove', TRUNCATE will remove all abscissa values that fall within this range (not including the data points specified in the input argument). The optional string 'index' specifies that TRUNCATE should treat the supplied values as indices rather than abscissa values.
If you pass in the string 'resetstart', TRUNCATE will set the minimum abscissa value to 0.
>> f=imat_fn(3);
>> f.ordinate=1:5;
>> f(2).abscissainc=0.5;
>> f(3).abscissa=[1 2 4 5.5 6];
>> f.abscissa
ans =
1.0000 1.0000 1.0000
2.0000 1.5000 2.0000
3.0000 2.0000 4.0000
4.0000 2.5000 5.5000
5.0000 3.0000 6.0000
>> g=truncate(f,[1.5 2.5])
g =
3x1 IMAT Function with the following attributes:
Record Name FunctionType AbscissaSpacing NumberElement
--------------------------- ---------------- ---------------- ----------------
1_(1X+,1X+) Time Response Even 1
2_(1X+,1X+) Time Response Even 3
3_(1X+,1X+) Time Response Uneven 1
>> g.abscissa
ans =
2.0000 1.5000 2.0000
NaN 2.0000 NaN
NaN 2.5000 NaN
>> g=truncate(f,[1.5 2.5],'remove')
g =
3x1 IMAT Function with the following attributes:
Record Name FunctionType AbscissaSpacing NumberElements
--------------------------- ---------------- ---------------- ----------------
1_(1X+,1X+) Time Response Uneven 4
2_(1X+,1X+) Time Response Uneven 2
3_(1X+,1X+) Time Response Uneven 4
>> g.abscissa
ans =
1.0000 1.0000 1.0000
3.0000 3.0000 4.0000
4.0000 NaN 5.5000
5.0000 NaN 6.0000