imat_shp/shp2fn


Purpose

Create an imat_fn from the supplied imat_shp.

Syntax

f=shp2fn(s)
f=shp2fn(s,ct)

Description

SHP2FN generates an imat_fn object from the supplied imat_shp object s. It will extract the shape coefficients for all of the shapes and assign the shape coefficients to a function record. One record will be generated for each degree of freedom in the shape. If the optional imat_ctrace ct is provided, it will create a function record for each coordinate in ct that is found in s. If inconsistent attributes are found, a warning will be issued but SHP2FN will continue. The ordinate numerator and denominator attributes from the first shape in s will be assigned to the imat_fn. The abscissa values will be set to the frequencies

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.

Examples

>> s=imat_shp(3,'shape',reshape(1:18,6,3),'frequency',100:102);
>> list(s)

Shape 1 - 100.000000 Hz, 0.000000 %Cr damping
ID Line 1:

      Node       Disp-X       Disp-Y       Disp-Z
-------------------------------------------------
         1            1            2            3
         2            4            5            6

Shape 2 - 101.000000 Hz, 0.000000 %Cr damping
ID Line 1:

      Node       Disp-X       Disp-Y       Disp-Z
-------------------------------------------------
         1            7            8            9
         2            10           11           12

Shape 3 - 102.000000 Hz, 0.000000 %Cr damping
ID Line 1:

      Node       Disp-X       Disp-Y       Disp-Z
-------------------------------------------------
         1           13           14           15
         2           16           17           18

>> f=shp2fn(s,imat_ctrace('1z'))

f =

IMAT Function with the following attributes:
Record Name                 FunctionType     AbscissaSpacing  NumberElements
--------------------------- ---------------- ---------------- ----------------
1_(,1Z+)                    General          Uneven           3

>> [f(1).abscissa f.ordinate]

ans =
     100     3
     101     9
     102    15

>> g=shp2fn(s)

g =

6x1 IMAT Function with the following attributes:

Record Name                 FunctionType     AbscissaSpacing  NumberElements
--------------------------- ---------------- ---------------- ----------------
1_(,1X+)                    General          Uneven           3
2_(,1Y+)                    General          Uneven           3
3_(,1Z+)                    General          Uneven           3
4_(,2X+)                    General          Uneven           3
5_(,2Y+)                    General          Uneven           3
6_(,2Z+)                    General          Uneven           3

>> [g(1).abscissa g.ordinate]

ans =
   100     1     2     3     4     5     6
   101     7     8     9    10    11    12
   102    13    14    15    16    17    18

>>

See Also

imat_fn/fn2shp