# mtimes

Laurent polynomial or Laurent matrix multiplication

## Syntax

``Q = mtimes(A,B)``
``Q = A * B``

## Description

example

````Q = mtimes(A,B)` returns the product of the pair of Laurent polynomials or Laurent matrices `A` and `B`. NoteThe `laurentPolynomial` and `laurentMatrix` objects have their own versions of `mtimes`. The input data type determines which version is executed. ```
````Q = A * B` is equivalent to ```Q = mtimes(A,B)```.```

## Examples

collapse all

Create three Laurent polynomials:

• $a\left(z\right)=4z+{z}^{-1}$

• $b\left(z\right)=2{z}^{2}+3z+{z}^{-1}$

• $c\left(z\right)={z}^{3}+3{z}^{2}+5z+7$

```a = laurentPolynomial(Coefficients=[4 0 1],MaxOrder=1); b = laurentPolynomial(Coefficients=[2 3 0 1],MaxOrder=2); c = laurentPolynomial(Coefficients=[1 3 5 7],MaxOrder=3);```

Multiply $a\left(z\right)$ and $b\left(z\right)$.

`ab = mtimes(a,b)`
```ab = laurentPolynomial with properties: Coefficients: [8 12 2 7 0 1] MaxOrder: 3 ```

Compute $a\left(z\right)c\left(z\right)-b\left(z\right)$.

`d = a*c-b`
```d = laurentPolynomial with properties: Coefficients: [4 12 19 28 5 6] MaxOrder: 4 ```

Create two Laurent polynomials:

• $a\left(z\right)=z+1$

• $b\left(z\right)={z}^{2}-{z}^{-1}$

```lpA = laurentPolynomial(Coefficients=[1 1],MaxOrder=1); lpB = laurentPolynomial(Coefficients=[1 0 0 -1],MaxOrder=2);```

Create two Laurent matrices:

• `lmatA` = $\left[\begin{array}{cc}\mathit{a}\left(\mathit{z}\right)& 1\\ 1& 0\end{array}\right]$

• `lmatB` = $\left[\begin{array}{cc}0& 2\\ 3& \mathit{b}\left(\mathit{z}\right)\end{array}\right]$

```lmatA = laurentMatrix(Elements={lpA,1;1,0}); lmatB = laurentMatrix(Elements={0,2;3,lpB});```

Multiply the matrices.

```lmat = lmatA*lmatB; lmat.Elements{1,1}```
```ans = laurentPolynomial with properties: Coefficients: 3 MaxOrder: 0 ```
`lmat.Elements{1,2}`
```ans = laurentPolynomial with properties: Coefficients: [1 2 2 -1] MaxOrder: 2 ```
`lmat.Elements{2,1}`
```ans = laurentPolynomial with properties: Coefficients: 0 MaxOrder: 0 ```
`lmat.Elements{2,2}`
```ans = laurentPolynomial with properties: Coefficients: 2 MaxOrder: 0 ```

## Input Arguments

collapse all

Laurent polynomial or Laurent matrix, specified as a `laurentPolynomial` object or a `laurentMatrix` object, respectively.

Laurent polynomial or Laurent matrix, specified as a `laurentPolynomial` object or a `laurentMatrix` object, respectively.

## Output Arguments

collapse all

Product of two Laurent polynomials or two Laurent matrices, returned as a `laurentPolynomial` object or a `laurentMatrix` object.

## Version History

Introduced in R2021b