nblocks
Number of control design blocks in generalized LTI model or generalized matrix
Syntax
Description
Examples
Number of Control Design Blocks in Second-Order Filter Model
Create a tunable (parametric) model of the second-order filter:
where the damping ζ and the natural frequency ωn are tunable parameters.
wn = realp('wn',3); zeta = realp('zeta',0.8); F = tf(wn^2,[1 2*zeta*wn wn^2]);
F
is agenss
model with two tunable control design blocks, therealp
blockswn
andzeta
. The blockswn
andzeta
have initial values of 3 and 0.8, respectively.Examine the number of tunable blocks in the model using
nblocks
.nblocks(F)
This command returns the result:
ans = 6
F
has two tunable parameters, but the parameterwn
appears five times — twice in the numerator and three times in the denominator.Rewrite
F
for fewer occurrences ofwn
.The second-order filter transfer function can be expressed as follows:
Use this expression to create the tunable filter:
F = tf(1,[(1/wn)^2 2*zeta*(1/wn) 1])
Examine the number of tunable blocks in the new filter model.
nblocks(F)
This command returns the result:
ans = 4
In the new formulation, there are only three occurrences of the tunable parameter
wn
. Reducing the number of occurrences of a block in a model can improve performance time of calculations involving the model. However, the number of occurrences does not affect the results of tuning the model or sampling the model for parameter studies.
Input Arguments
M
— Generalized LTI model or matrix
genss
object | genfrd
object | genmat
object | array
Generalized matrix or model, specified as a generalized LTI model (genss
or genfrd
object), a
generalized matrix (genmat
object), or an
array of such objects.
Output Arguments
N
— Number of control design blocks
integer | integer array
Number of Control Design Blocks in
M
, returned as an integer when
M
is a single model or integer array when
M
is a model array.
If M
is a model array, N
is
an array with the same dimensions as M
. Each
entry of N
is the number of control design blocks
in the corresponding entry of M
.
If a block appears multiple times in M
or an
element of M
, N
reflects the
total number of occurrences.
Version History
Introduced in R2011a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)