# tf

Constructs a transfer function model

## Syntax

SYS = tf()

SYS = tf('s')

SYS = tf('z', Ts)

SYS = tf(S)

SYS = tf(SYSIN)

SYS = tf(NUM, DEN)

SYS = tf(NUM, DEN, Ts)

SYS = tf(NUM, DEN, Ts, 'variable', 'var')

## Inputs

`S`- A scalar (static gain).
`NUM`- The numerator polynomial coefficients, stored as a row vector or as a cell array of row vectors.
`DEN`- The denominator polynomial coefficients, stored as a row vector or as a cell array of row vectors.
`SYSIN`- State-space or transfer function model.
`Ts`- Sampling time
`Ts`(in seconds). `var`- A string, either 'z^-1' or 'z' (default) to indicate the displayed polynomial variable.

## Outputs

- SYS
- The transfer function model.

## Examples

```
num = [3 4];
den = [3 1 5];
Ts = 0.2;
sys = tf(num, den, Ts)
```

```
Transfer function for input 1, output 1
3 z + 4
-------------
3 z^2 + z + 5
Sampling Time: 0.2 s
```

```
num = [3 4];
den = [3 1 5];
Ts = 0.2;
sys = tf(num, den, Ts, 'variable', 'z^-1')
```

```
Transfer function for input 1, output 1
3 z^-1 + 4 z^-2
-----------------
3 + z^-1 + 5 z^-2
Sampling Time: 0.2 s
```

```
sys = ss(1,2,3,4);
sys_tf = tf(sys)
```

```
Transfer function for input 1, output 1
4 s + 2
-------
s - 1
```

## Comments

SYS = tf(NUM, DEN) constructs a continuous-time transfer function
model with numerator `NUM` and denominator `DEN`.

Adding `Ts` parameter allows you to define the discrete-time transfer
function.

`Ts` = -1 leaves the sampling time unspecified. In this
case, the input arguments are considered to be continuous-time.

When `NUM` and `DEN` have different lengths, the shorter
vector is treated as having implicit leading zeros. See filt for
comparison.

For MIMO systems, the cell arrays of polynomials will have the dimension q x p, where q is the number of outputs and p is the number of inputs.