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

    %% Compare Identified Nonparametric and Parametric Models  
% Identify parametric and nonparametric models for a data set, and compare
% their step response.   

% Copyright 2015 The MathWorks, Inc.


%% 
% Identify the impulse response model (nonparametric) and state-space model
% (parametric), based on a data set. 
load iddata1 z1;
sys1 = impulseest(z1);
sys2 = ssest(z1,4); 

%%
% |sys1| is a discrete-time identified transfer function model. |sys2| is a
% continuous-time identified state-space model.

%% 
% Compare the step response for |sys1| and |sys2|. 
step(sys1,'b',sys2,'r');
legend('impulse response model','state-space model');