www.gusucode.com > econ 案例源码程序 matlab代码 > econ/RetrieveModelPropertiesExample.m

    %% Retrieve Model Properties
% The property values in an existing model are retrievable. Working
% with models resembles working with |struct| arrays because you can
% access model properties using dot notation. That is, type the model
% name, then the property name, separated by |'.'| (a period).
%%
% For example, consider the |arima| model with this AR(2)
% specification:

% Copyright 2015 The MathWorks, Inc.

Mdl = arima('AR',{0.8,-0.2},'Variance',0.2,'Constant',0);
%%
% To display the value of the property |AR| for the created model, enter:
arCoefficients = Mdl.AR
%%
% |AR| is a cell array, so you must use cell-array syntax. The coefficient
% cell arrays are lag-indexed, so entering
secondARCoefficient = Mdl.AR{2}
%%
% returns the coefficient at lag 2. You can also assign any property value
% to a new variable:
ar = Mdl.AR