Summing junction for name-based interconnections
S = sumblk(formula)
S = sumblk(formula,signalsize)
S = sumblk(formula,signames1,signames2,...)
创建传递函数,S
= sumblk(formula
)S
, of the summing junction described byformula
. The character vectorformula
specifies an equation that relates the scalar input and output signals ofS
.
returns a vector-valued summing junction. The input and output signals are vectors withS
= sumblk(formula
,signalsize
)signalsize
elements.
replaces aliases (signal names beginning withS
= sumblk(formula
,signames1,signames2,...)%
) informula
by the signal namessignames
. The number ofsignames
arguments must match the number of aliases informula
. The first alias informula
is replaced bysignames1
, the second bysignames2
, and so on.
|
Equation that relates the input and output signals of the summing junction transfer function S = sumblk('e = r - y + d') creates a summing junction with input names If you specify a S = sumblk('v = u + d',2) specifies a summing junction with input names You can use one or more aliases in 个性化别名是有用的,当你想要的名字l entries in a vector-valued signal. Aliases also allow you to use input or output names of existing models. For example, if S = sumblk('%e = r - %y',C.InputName,G.OutputName)
|
|
Number of elements in each input and output signal of Default:1 |
|
Signal names to replace one alias (signal name beginning with Specify
|
|
Transfer function for the summing junction, represented as a MIMO |
Summing Junction with Scalar-Valued Signals
Create the summing junction of the following illustration. All signals are scalar-valued.
This summing junction has the formulau = u1 + u2 + u3
.
S = sumblk('u = u1+u2+u3');
S
is the transfer function (tf
) representation of the sumu = u1 + u2 + u3
. The transfer functionS
gets its input and output names from the formula.
S.OutputName,S.Inputname
ans = 'u' ans = 'u1' 'u2' 'u3'
Summing Junction with Vector-Valued Signals
Create the summing junctionv = u - d
whereu,d,v
are vector-valued signals of length 2.
S = sumblk('v = u-d',2);
sumblk
automatically performs vector expansion of the signal names ofS
.
S.OutputName,S.Inputname
ans = 'v(1)' 'v(2)' ans = 'u(1)' 'u(2)' 'd(1)' 'd(2)'
Summing Junction with Vector-Valued Signals That Have Specified Signal Names
Create the summing junction
The signalsalpha
andq
have custom names that are not merely the vector expansion of a single signal name. Therefore, use an alias in the formula specifying the summing junction.
S = sumblk('e = setpoint - %y + d', {'alpha';'q'});
sumblk
replaces the alias%y
with the cell array{'alpha';'q'}
.
S.OutputName,S.Inputname
ans = 'e(1)' 'e(2)' ans = 'setpoint(1)' 'setpoint(2)' 'alpha' 'q' 'd(1)' 'd(2)'
Usesumblk
in conjunction withconnect
to interconnect dynamic system models and derive aggregate models for block diagrams.