# Conversion Zero-Pole Gain Transfer Function To Polynomial In MatLab®

To make designing control systems easy, Matlab® provides lots of kinds of tools and commands. One of these commands is the ‘zp2tf()’ command. With this command, you can easily convert the transfer function which is given in the zero-pole gain form, into polynomial form.

Also, there is another command that you can do the reverse of this thing in Matlab®.

Here we explain the use of the ‘zp2tf()’ command in Matlab® with a very basic code example. You can try this code in your Matlab® product.

YOU CAN LEARN MatLab® IN MECHANICAL BASE; Click And Start To Learn MatLab®!

## How To Use The ‘zp2tf()’ Command In MatLab®?

You know that the transfer functions are very important aspects of control system design. These transfer functions can be in different forms and the designer can need them in other forms. If a transfer function is given in the zero-pole gain form, you can convert it to polynomial form with the ‘zp2tf()’ command. Check the coding example below.

```
>> x = [-6.7016; -0.2984];
y = [-4;-3;-2];
z = [1];
[nom,denom]=zp2tf(x,y,z)
nom =
0 1.0000 7.0000 1.9998
denom =
1 9 26 24
>>
```

As you see above, the use of the ‘zp2tf()’ command is very simple in Matlab®. First of all, we need to create the required column vectors that include the roots of the nominator and denominator of the zero-pole gain transfer function. In this example, these vectors are ‘x’ and ‘y’. And we need to type these vectors inside the parentheses of the ‘zp2tf()’ command.

We need to equate the ‘zp2tf()’ command to two result variables. These variables are ‘nom’ and ‘denom’ here. Take care about the syntax to work the code properly.

If you look at the result;

The given zero-pole gain transfer function is like this;

TF = (s+6.7016)(s+0.298)/(s+2)(s+3)(s+4)

And the converted transfer function which is in polynomial form;

TF = (s^2+7s+2)/(s^3+9s^2+26s+24)

So, the variable ‘nom’ gives the nominator of the polynomial form of the transfer function and ‘denom’ gives the denominator of the polynomial form.

## Conclusion

The use of the ‘zp2tf()’ command in Matlab® is very simple like this.

Do not forget to leave your comments and questions below about the use of the ‘zp2tf()’ command in Matlab® below.

If you want further coding examples about the ‘zp2tf()’ command in Matlab®, inform us in the comments.

This article is prepared for completely educative and informative purposes. Images used courtesy of Matlab®

Your precious feedbacks are very important to us.