You can extract the following numerical data from linear model objects:
Coefficients and uncertainty
For example, extract state-space matrices (
for state-space models, or polynomials (
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)
getcov command. 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
in an ARX model, returned by the
and displayed by the
The following table summarizes the commands for extracting model coefficients and uncertainty.
Commands for Extracting Model Coefficients and Uncertainty Data
|Extracts frequency-response data (|
[H,w,CovH] = freqresp(m)
|Extracts polynomials (such as |
[A,B,C,D,F,dA,dB,dC,dD,dF] = ... polydata(m)
|Extracts state-space matrices (such as |
[A,B,C,D,K,X0,... dA,dB,dC,dD,dK,dX0] = ... idssdata(m)
|Extracts numerator and denominator polynomials (|
[Num,Den,Ts,dNum,dDen] = ... tfdata(m)
|Extracts zeros, poles, and gains (|
[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,
the A polynomial coefficients from model
Alternatively, you can use the
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.