Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
workspace as f ive column vectors H11, H12, H21, H22, and freq. The
vector freq contains 100 test f requencies. The other f our vectors contain the corresponding complex-valued f requency
response of each I/O pair of a two-input, two-output system.
Tip To inspect these variables, enter:
whos H11 H12 H21 H22 freq
2. Organize the data into a three-dimensional array.
Hresp = zeros(2,2,length(freq));
Hresp(1,1,:) = H11;
Hresp(1,2,:) = H12;
Hresp(2,1,:) = H21;
Hresp(2,2,:) = H22;
The dimensions of Hresp are the number of outputs, number of inputs, and the number of f requencies f or which there is
response data. Hresp(i,j,:) contains the f requency response f rom input j to output i.
3. Create a f requency-response model.
H = frd(Hresp,freq);
sys is an frd model object, which is a data container f or representing f requency response data.
You can use frd models with many f requency-domain analysis commands. For example, visualize the response of this two-input,
two-output system using bode.
Tip By def ault, the frd command assumes that the f requencies are in radians/second. To specif y dif f erent f requency
units, use the TimeUnit and FrequencyUnit properties of the frd model object. For example:
sys = frd(Hresp,freq,'TimeUnit','min','FrequencyUnit','rad/TimeUnit')
sets the f requency units to in radians/minute.
More About
Select Input/Output Pairs in MIMO Models
This example shows how to select the response f rom the f irst input to the second output of a MIMO model.
1. Create a two-input, one-output transf er f unction.
N = {[1 -1],[1];[1 2],[3 1 4]};
D = [1 1 10];
H = tf(N,D)
Note: For more inf ormation about using cell arrays to create MIMO transf er f unctions, see the tf ref erence page.
2. Select the response f rom the second input to the output of H.
To do this, use MATLAB array indexing.
H12 = H(1,2)
For any MIMO system H, the index notation H(i,j) selects the response f rom the jth input to the ith output.