www.gusucode.com > ident 案例代码 matlab源码程序 > ident/EstimateMultiOutputARMAXModelExample.m

    %% Estimate Multi-Output ARMAX Model  
% Estimate a multi-output ARMAX model for a multi-input, multi-output data set.   

%% 
% Load estimation data. 
load iddata1 z1
load iddata2 z2
data = [z1 z2(1:300)]; 

%%
% |data| is a data set with 2 inputs and 2 outputs. The first input affects
% only the first output. Similarly, the second input affects only the second
% output.  

%% 
% Specify the model orders and delays. The |F| and |D| polynomials are 
% inactive. 
na = [2 2; 2 2]; 
nb = [2 2; 3 4]; 
nk = [1 1; 0 0]; 
nc = [2;2]; 
nd = [0;0]; 
nf = [0 0; 0 0];

%%
% Estimate the model.
sys = polyest(data,[na nb nc nd nf nk]);

%%
% In the estimated ARMAX model, the cross terms, which model the effect of
% the first input on the second output and vice versa, are negligible. If
% you assigned higher orders to those dynamics, their estimation would show
% a high level of uncertainty.   

%% 
% Analyze the results. 
h = bodeplot(sys);
showConfidence(h,3) 

%%
% The responses from the cross terms show larger uncertainty.