tensorprod
Syntax
Description
C = tensorprod(
returns the tensor product of
tensors A,B,dimA,dimB)A and B. The arguments dimA
and dimB are vectors that specify which dimensions to contract in
A and B. The size of the output tensor is the size
of the uncontracted dimensions of A followed by the size of the
uncontracted dimensions of B.
C = tensorprod(
returns the outer product
between tensors A,B)A and B. This syntax is equivalent to
using one of the previous syntaxes with dimA = dimB = [] or dim
= []. The size of the output tensor is [size(A)
size(B)].
C = tensorprod(
returns the inner product
between tensors A,B,"all")A and B, which must be the same size.
The output is a scalar.
C = tensorprod(___,NumDimensionsA=
optionally specifies the number of dimensions in tensor ndimsA)A in addition to
any of the input argument combinations in previous syntaxes. Use this option when
A has trailing singleton dimensions that are expected to be passed on
to the output. For example, tensorprod(A,B,NumDimensionsA=4) calculates
the outer product between tensors A and B where
A has a total of four dimensions.
Examples
Input Arguments
More About
Extended Capabilities
Version History
Introduced in R2022a