imat_shp/mtimes


Purpose

Matrix multiply shape coefficients (A*s).

Syntax

t=A*s
t=s*A

Description

Matrix multiplication between a numeric array A and an imat_shp object s is performed repeatedly at all shape coefficients. This type of operation requires that all elements of s have the same node numbers and DOF, and that the column dimension of the left operand matches the row dimension of the right operand. At each shape coefficient, a matrix or vector the same dimension as s is formed, and the matrix product is computed. The resulting matrix or vector is placed into the shape of the result, with the same nodes and DOF as s. The data attributes of the result are taken from s(1). In particular, the units exponents will be set assuming that A is a unitless quantity.

Note that A*s does not give a shape equal to A*(s.shape). In the first expression, A must have column dimension equal to the row dimension of s. In the second expression, A must have column dimension equal to the number of shape coefficients in s.

Examples

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

s =
3x1 IMAT Shape with the following attributes:
Row Frequency           Damping             NumberNodes
--- ------------------- ------------------- -------------------
1   1                   0.01                2
2   2                   0.01                2
3   3                   0.01                2

>> s.shape                   % s is 3x1 with 6 shape coefficients

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

>> x=[1 -1 0 ; -1 0 1]       % x is 2x3 (ncols = nrows of s)

x =
     1    -1     0
    -1     0     1

>> t=x*s;   t.shape          % t is 2x1 with 6 shape coefficients

ans =
    -6    12
    -6    12
    -6    12
    -6    12
    -6    12
    -6    12

>> t                         % Note all outputs have attributes of t(1)

t =
2x1 IMAT Shape with the following attributes:
Row Frequency           Damping             NumberNodes
--- ------------------- ------------------- -------------------
1   1                   0.01                2
2   1                   0.01                2

>>

See Also

imat_shp/mldivide, imat_shp/mrdivide