Main Content

# evalfr

Evaluate frequency response at given frequency

## Syntax

```frsp = evalfr(sys,f) ```

## Description

`frsp = evalfr(sys,f) ` evaluates the transfer function of the TF, SS, or ZPK model `sys` at the complex number `f`. For state-space models with data (ABCD), the result is

H(f) = D + C(fI – A)–1B

`evalfr` is a simplified version of `freqresp` meant for quick evaluation of the response at a single point. Use `freqresp` to compute the frequency response over a set of frequencies.

## Examples

collapse all

Create the following discrete-time transfer function.

`$H\left(z\right)=\frac{z-1}{{z}^{2}+z+1}$`

`H = tf([1 -1],[1 1 1],-1);`

Evaluate the transfer function at `z = 1+j`.

```z = 1+j; evalfr(H,z)```
```ans = 0.2308 + 0.1538i ```

Create the following continuous-time transfer function model:

`$H\left(s\right)=\frac{1}{{s}^{2}+2s+1}$`

`sys = idtf(1,[1 2 1]);`

Evaluate the transfer function at frequency 0.1 rad/second.

```w = 0.1; s = j*w; evalfr(sys,s)```
```ans = 0.9705 - 0.1961i ```

Alternatively, use the `freqresp` command.

`freqresp(sys,w)`
```ans = 0.9705 - 0.1961i ```

## Limitations

The response is not finite when `f` is a pole of `sys`.

## Version History

Introduced before R2006a