frdfun
Apply a function to the frequency response value at each frequency of an
frd model object
Syntax
Description
Examples
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 =
Frequency(rad/s) Response
---------------- --------
0.0100 -0.1648 + 9.847e-04i
0.0359 -0.1644 + 3.508e-03i
0.1292 -0.1597 + 1.130e-02i
0.4642 -0.1294 + 9.857e-03i
1.6681 -0.1058 - 7.515e-02i
5.9948 -0.1883 - 3.050e-01i
21.5443 -0.7004 - 5.495e-01i
77.4264 -1.1337 - 2.623e-01i
278.2559 -1.1946 - 7.725e-02i
1000.0000 -1.1996 - 2.159e-02i
Continuous-time frequency response.
Model Properties
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.
sysImag = frdfun(@imag,sys)
sysImag =
Frequency(rad/s) Response
---------------- --------
0.0100 9.847e-04
0.0359 3.508e-03
0.1292 1.130e-02
0.4642 9.857e-03
1.6681 -7.515e-02
5.9948 -3.050e-01
21.5443 -5.495e-01
77.4264 -2.623e-01
278.2559 -7.725e-02
1000.0000 -2.159e-02
Continuous-time frequency response.
Model Properties
You can also obtain the magnitude of the frequency response of sys with the abs function.
sysMag = frdfun(@abs,sys)
sysMag =
Frequency(rad/s) Response
---------------- --------
0.0100 0.1648
0.0359 0.1644
0.1292 0.1601
0.4642 0.1298
1.6681 0.1298
5.9948 0.3585
21.5443 0.8902
77.4264 1.1637
278.2559 1.1971
1000.0000 1.1998
Continuous-time frequency response.
Model Properties
For this example, consider a 2x2 MIMO frequency response model sys that contains 100 test frequencies for each I/O pair.
Load the frd object sys from the MAT-file frdModelMIMO.mat.
load('frdModelMIMO.mat','sys') size(sys)
FRD model with 2 outputs, 2 inputs, and 100 frequency points.
Define a function to compute the magnitude of the frequency response of the second I/O pair in sys.
fun = @(h) abs(h(2,2));
Use the frdfun command to apply the function fun to the specific I/O pair in sys.
fsys = frdfun(fun,sys);
Input Arguments
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.
Output Arguments
Version History
Introduced in R2020a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)