Current value of Generalized Model
curval = getValue(M)
curval = getValue(M,blockvalues)
curval = getValue(M,Mref)
returns the current value curval
= getValue(M
)curval
of the Generalized LTI model or Generalized matrix
M
. The current value is obtained by replacing all Control Design Blocks in M
by
their current value. (For uncertain blocks, the “current value” is the
nominal value of the block.)
uses the block values specified in the structure curval
= getValue(M
,blockvalues
)blockvalues
to
compute the current value. The field names and values of
blockvalues
specify the block names and corresponding values.
Blocks of M
not specified in blockvalues
are
replaced by their current values.
inherits block values from the generalized model curval
= getValue(M
,Mref
)Mref
. This syntax
is equivalent to curval
=
getValue(M
,Mref.Blocks
). Use this syntax to
evaluate the current value of M
using block values computed
elsewhere (for example, tuned values obtained with tuning commands such as systune
, looptune
, or the Robust Control Toolbox™ command hinfstruct
(Robust Control Toolbox)).
 

Structure specifying blocks of The field names of 

Generalized LTI model. If you provide 

Numeric array or Numeric LTI
model representing the current value of If you do not specify a replacement value for a given Control Design Block
of 
Evaluate Model for Specified Values of its Blocks
This example shows how to replace a Control Design Block in a Generalized LTI
model with a specified replacement value using getValue
.
Consider the following closedloop system:
The following code creates a genss
model of this system with $$G\left(s\right)=\frac{\left(s1\right)}{{\left(s+1\right)}^{3}}$$ and a tunable PI controller C.
G = zpk(1,[1,1,1],1); C = tunablePID('C','pi'); Try = feedback(G*C,1)
The genss
model Try
has one Control Design
Block, C
. The block C
is initialized to
default values, and the model Try
has a current value that
depends on the current value of C
. Use
getValue
to evaluate C
and
Try
to examine the current values.
Evaluate C
to obtain its current value.
Cnow = getValue(C)
This command returns a numeric pid
object whose
coefficients reflect the current values of the tunable parameters in
C
.
Evaluate Try
to obtain its current value.
Tnow = getValue(Try)
This command returns a numeric model that is equivalent to
feedback(G*Cnow,1)
.
Access Values of Tuned Models and Blocks
Propagate changes in block values from one model to another using
getValue
.
This technique is useful for accessing values of models and blocks tuned with
tuning commands such as systune
, looptune
, or hinfstruct
(Robust Control Toolbox). For example, if you
have a closedloop model of your control system T0
, with two
tunable blocks, C1
and C2
, you can tune it
using:
[T,fSoft] = systune(T0,SoftReqs);
You can then access the tuned values of C1
and
C2
, as well as any closedloop model H
that depends on C1
and C2
, using the
following:
C1t = getValue(C1,T); C2t = getValue(C2,T); Ht = getValue(H,T);
genss
 looptune
 replaceBlock
 systune
 hinfstruct
(Robust Control Toolbox)