For this example, create a frequency response data model by computing the response of a transfer function on a grid of frequencies. For this example, assume a set of 10 frequencies.
H = tf([-1.2,-2.4,-1.5],[1,20,9.1]);
w = logspace(-2,3,10);
sys = frd(H,w)
sys is a SISO frequency response data (frd) model containing the frequency response at 10 frequencies.
Use the frdfun command to apply the function imag on the frd model sys to obtain the imaginary parts of the frequency response as a function of frequency.
fun — Function to be applied to frd model MATLAB® function
Function to be applied to frd model, specified as a MATLAB function. The function fun must accept a single
matrix and return a scalar, vector, or matrix of fixed size across frequency.
sys — Frequency response data model frd model object | genfrd model object | ufrd model object
Frequency response data model, specified as an frd,
genfrd, or ufrd model object. When you specify
sys as a genfrd or ufrd (Robust Control Toolbox) object, frdfun
converts it to an frd object first before applying the function
fun.
For more information on frequency response data models, see frd.
fsys — Output frequency response data model frd model object
Output frequency response data model, returned as an frd model
object. frdfun applies the function fun to the
frequency response value at each frequency of sys and collects the
results in fsys.
For more information on frequency response data models, see frd.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.