tensor

Syntax

t = tensor(a<,n2><,n3><,n4><,n5><,n6>)

Create a tensor. A tensor is, by definition, symmetric and 3 × 3 in size.

Returns:

t - tensor

Arguments:

a - Matrix, array, 3D vector, or number. The following conditions apply.

  • If a matrix is provided, then the matrix must be 3 × 3 and symmetric.
  • If an array is provided, then the array must have two dimensions, and each dimension must be at least size two. The diagonal components of the array are assigned to the diagonal components of the tensor. If the array can be mapped directly to a 3 × 3 matrix, then the xy component is set to the average of the [1,2] and [2,1] array components, the xz component is set to the average of the [1,3] and [3,1] array components, and the yz component is set to the average of the [2,3] and [3,2] array components. If the array can be mapped directly to a 2 × 2 matrix, then the xy component is set to the average of the [1,2] and [2,1] array components.
  • If a 3D vector is provided, then the diagonal components are set to the x, y, and z components of the vector.
  • If a number is provided (e.g., an integer or a float), then this is the xx component.

n2 - Optional yy component that can only be provided if a is also a number.

n3 - Optional zz component that can only be provided if a is also a number.

n4 - Optional xy component that can only be provided if a is also a number.

n5 - Optional xz component that can only be provided if a is also a number.

n6 - Optional yz component that can only be provided if a is also a number.