# How do I evaluate a certain transfer function at desired frequencies numerically?

From Murray Wiki

Jump to navigationJump to search
There are several ways to do it other than writing out the transfer function explicitly:

1. If you'd like to evaluate G(s) at a single frequency f (f is real, in Hz), you can use: evalfr(G,i*f)

2. For a range of angular frequencies w (w is real, in rad/s), either:

- Use H = freqresp(G,w) and use squeeze(H) to get an array; H is complex
- Use [mag phase] = bode(G,w) to get the magnitude and phase separately; use squeeze() accordingly.

--Shuo