Main Content


Access data for frequency response data (FRD) object


[response,freq] = frdata(sys)
[response,freq,covresp] = frdata(sys)
[response,freq,Ts,covresp] = frdata(sys,'v')
[response,freq,Ts] = frdata(sys)


[response,freq] = frdata(sys) returns the response data and frequency samples of the FRD model sys. For an FRD model with Ny outputs and Nu inputs at Nf frequencies:

  • response is an Ny-by-Nu-by-Nf multidimensional array where the (i,j) entry specifies the response from input j to output i.

  • freq is a column vector of length Nf that contains the frequency samples of the FRD model.

See the frd reference page for more information on the data format for FRD response data.

[response,freq,covresp] = frdata(sys) also returns the covariance covresp of the response data resp for idfrd model sys. (Using idfrd models requires System Identification Toolbox™ software.) The covariance covresp is a 5D-array where covH(i,j,k,:,:) contains the 2-by-2 covariance matrix of the response resp(i,j,k). The (1,1) element is the variance of the real part, the (2,2) element the variance of the imaginary part and the (1,2) and (2,1) elements the covariance between the real and imaginary parts.

For SISO FRD models, the syntax

[response,freq] = frdata(sys,'v')

forces frdata to return the response data as a column vector rather than a 3-dimensional array (see example below). Similarly

[response,freq,Ts,covresp] = frdata(sys,'v') for an IDFRD model sys returns covresp as a 3-dimensional rather than a 5-dimensional array.

[response,freq,Ts] = frdata(sys) also returns the sample time Ts.

Other properties of sys can be accessed with get or by direct structure-like referencing (e.g., sys.Frequency).


The input argument sys to frdata must be an FRD model.


collapse all

Create a frequency response data model by computing the response of a transfer function on a grid of frequencies.

H = tf([-1.2,-2.4,-1.5],[1,20,9.1]);
w = logspace(-2,3,101);
sys = frd(H,w);

sys is a SISO frequency response data (frd) model containing the frequency response at 101 frequencies.

Extract the frequency response data from sys.

[response,freq] = frdata(sys);

response is a 1-by-1-by-101 array. response(1,1,k) is the complex frequency response at the frequency freq(k).

Version History

Introduced before R2006a

See Also

| | |