# minus

Laurent polynomial or Laurent matrix subtraction

## Syntax

``Q = minus(A,B)``
``Q = A - B``

## Description

example

````Q = minus(A,B)` subtracts `B` from `A`, where `A` and `B` are a pair of Laurent polynomials or Laurent matrices. NoteThe `laurentPolynomial` and `laurentMatrix` objects have their own versions of `minus`. The input data type determines which version is executed. ```
````Q = A - B` is equivalent to ```Q = minus(A,B)```.```

## Examples

collapse all

Create two Laurent polynomials:

• $a\left(z\right)=2z$

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

```a = laurentPolynomial(Coefficients=[2],MaxOrder=1); b = laurentPolynomial(Coefficients=[8 4 2 1],MaxOrder=3);```

Subtract $a\left(z\right)$ from $b\left(z\right)$.

`c = minus(b,a)`
```c = laurentPolynomial with properties: Coefficients: [8 4 0 1] MaxOrder: 3 ```

Subtract ${a}^{3}\left(z\right)+{a}^{2}\left(z\right)$ from $b\left(z\right)$.

`d = b-(mpower(a,3)+mpower(a,2))`
```d = laurentPolynomial with properties: Coefficients: [2 1] MaxOrder: 1 ```

Create the Laurent polynomials:

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

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

```lpA = laurentPolynomial(Coefficients=[5 8 3],MaxOrder=2); lpB = laurentPolynomial(Coefficients=[8 3 2],MaxOrder=1);```

Create the Laurent matrices:

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

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

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

Subtract `lmatB` from `lmatA`.

```lmatC = lmatA-lmatB; lmatC.Elements{1,1}```
```ans = laurentPolynomial with properties: Coefficients: [5 0 0 -2] MaxOrder: 2 ```
`lmatC.Elements{1,2}`
```ans = laurentPolynomial with properties: Coefficients: 1 MaxOrder: 0 ```
`lmatC.Elements{2,1}`
```ans = laurentPolynomial with properties: Coefficients: 1 MaxOrder: 0 ```
`lmatC.Elements{2,2}`
```ans = laurentPolynomial with properties: Coefficients: 1 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

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

## Version History

Introduced in R2021b