Extracting Numerical Model Data
You can extract the following numerical data from linear model objects:
Coefficients and uncertainty
For example, extract state-space matrices (
K) for state-space models, or polynomials (
F) for polynomial models.
If you estimated model uncertainty data, this information is stored in the model in the form of the parameter covariance matrix. You can fetch the covariance matrix (in its raw or factored form) using the
getcovcommand. The covariance matrix represents uncertainties in parameter estimates and is used to compute:
Confidence bounds on model output plots, Bode plots, residual plots, and pole-zero plots
Standard deviation in individual parameter values. For example, one standard deviation in the estimated value of the
Apolynomial in an ARX model, returned by the
polydatacommand and displayed by the
The following table summarizes the commands for extracting model coefficients and uncertainty.
Commands for Extracting Model Coefficients and Uncertainty Data
Command Description Syntax
Extracts frequency-response data (
H) and corresponding covariance (
CovH) from any linear identified model.
[H,w,CovH] = freqresp(m)
Extracts polynomials (such as
A) from any linear identified model. The polynomial uncertainties (such as
dA) are returned only for
[A,B,C,D,F,dA,dB,dC,dD,dF] = ... polydata(m)
Extracts state-space matrices (such as
A) from any linear identified model. The matrix uncertainties (such as
dA) are returned only for
[A,B,C,D,K,X0,... dA,dB,dC,dD,dK,dX0] = ... idssdata(m)
Extracts numerator and denominator polynomials (
Den) and their uncertainties (
dden) from any linear identified model.
[Num,Den,Ts,dNum,dDen] = ... tfdata(m)
Extracts zeros, poles, and gains (
K) and their covariances (
covK) from any linear identified model.
[Z,P,K,Ts,covZ,covP,covK] = ... zpkdata(m)
Obtain a list of model parameters and their uncertainties.
To access parameter attributes such as values, free status, bounds or labels, use
pvec = getpvec(m)
Obtain parameter covariance information
cov_data = getcov(m)
You can also extract numerical model data by using dot notation to access model properties. For example,
m.Adisplays the A polynomial coefficients from model
m. Alternatively, you can use the
getcommand, as follows:
To view a list of model properties, type
Dynamic and noise models
For linear models, the general symbolic model description is given by:
G is an operator that takes the measured inputs u to the outputs and captures the system dynamics, also called the measured model. H is an operator that describes the properties of the additive output disturbance and takes the hypothetical (unmeasured) noise source inputs e to the outputs, also called the noise model. When you estimate a noise model, the toolbox includes one noise channel e for each output in your system.
You can operate on extracted model data as you would on any other MATLAB® vectors, matrices and cell arrays. You can also pass these numerical values to Control System Toolbox™ commands, for example, or Simulink® blocks.