Create an imat_shp from the supplied imat_fn.
s=fn2shp(f)
s=fn2shp(f,index)
s=fn2shp(f,'byval',[800 820])
FN2SHP generates an imat_shp object from the supplied imat_fn object. After checking attributes for consistency, it will assign the ordinate value of each coordinate to the corresponding imat_shp for each abscissa point specified. The imat_shp frequency will be set to the corresponding abscissa value. The output imat_shp object will be an nx1 shape, where n is the number of abscissa values in the imat_fn.
An optional input vector, index, can be used to specify the abscissa indices to use in creating the shape.
Another way of indexing involves passing in the string 'byval', followed by a list of frequencies or frequency ranges. If VALLIST is an Nx1 vector, FN2SHP will find the closest abscissa value to the values in VALLIST. If VALLIST is an Nx2 matrix, FN2SHP will treat each row as a start and end abscissa value, and will create a shape for each abscissa value within the specified range.
>> f=imat_fn(3,'ordinate',reshape(1:15,5,3));
>> f.responsenode=(1:3)'
f =
3x1 IMAT Function with the following attributes:
Record Name FunctionType AbscissaSpacing NumberElements
-------------------- ---------------- ---------------- ----------------
1_(1X+,1X+) Time Response Even 5
2_(1X+,2X+) Time Response Even 5
3_(1X+,3X+) Time Response Even 5
>> [f(1).abscissa f.ordinate] % f is 3x1 with 5 abscissa values
ans =
1 1 6 11
2 2 7 12
3 3 8 13
4 4 9 14
5 5 10 15
>> shp=fn2shp(f)
shp =
5x1 IMAT Shape with the following attributes:
Row Frequency Damping NumberNodes
--- ------------------- ------------------- -------------------
1 1 0 3
2 2 0 3
3 3 0 3
4 4 0 3
5 5 0 3
>> shp.shape
ans =
1 2 3
4 5
0 0
0 0 0
0 0
0 0 0
6 7
8 9 10
0 0
0 0 0
0 0
0 0 0
11 12 13 14 15
0 0
0 0 0
0 0
0 0 0
>> shp=fn2shp(f,3);
>> shp.shape
ans =
3
0
0
8
0
0
13
0
0
>>