| Abs | 1 | For the decision count, the Abs block can be treated as
an if-else statement:
If the input to the Abs block is less than zero, the
output of the Abs block is the input multiplied by negative
1. Otherwise, by default, the output of the Abs block is
equal to the input of the Abs block.
An if-else statement has a
decision count of 1 because the if statement represents one
decision and the else statement represents the default
behavior (no decisions made). |
| Combinatorial Logic | Number of rows in the Truth table parameter minus
1 | The decision count depends on the number of rows in the truth
table. If a truth table contains five rows, the decision count is 4.
One row in the truth table contains the default output and the other four rows
contain potential outputs that depend on a decision being made. Note The metric expects that you specify the truth table directly inside the
Combinatorial Logic block and that you specify the
Truth table parameter by using a matrix that defines
all possible block outputs. If the metric is unable to parse the matrix, the
metric returns a decision count of 1. |
| Dead Zone | 2 | The output of the Dead Zone block depends on the block
input (U) and the values of the Start of dead
zone(lower limit, LL) and End of dead
zone (upper limit, UL)
parameters. For the decision count, the Dead Zone
block can be treated as an if-elseif-else statement:
If U >= LL and U <= UL, the
output is 0. If U > UL, the output is U -
UL. Otherwise, the output is U - LL.
An if-elseif-else statement
has a decision count of 2 because the if statement represents
one decision, the elseif statement represents one decision,
and the else statement represents the default behavior (no
decisions made). |
| Delay | Either 0, 1, or 2 | The decision count depends on the Show enable port
parameter and the External reset parameter.
If you clear the Show enable port check box and
you set External reset to None,
the decision count is 0. If you select Show enable port and you set
External reset to None, the
decision count is 1. If you clear the Show enable port check box and
you set External reset to a value other than
None, the decision count is 1. If you select Show enable port and you set
External reset to a value other than
None, the decision count is 2.
|
| Discrete-Time Integrator | Either 0, 1, 2, or 3 | The decision count depends on the External reset
parameter and the Limit output parameter.
If you set External reset to
none and you clear the Limit
output check box, the decision count is 0. If you set External reset to a value other than
none and you clear the Limit
output check box, the decision count is 1. If you set External reset to
none and you select Limit
output, the decision count is 2. If you set External reset to a value other than
none and you select Limit
output, the decision count is 3.
|
| Discrete Filter | Either 0 or 1 | The decision count depends on the External reset
parameter.
If External reset is set to
None, the decision count is 1. Otherwise, the decision count is 0.
|
| Discrete FIR Filter | Either 0, 1, or 2 | The decision count depends on the Show enable port
parameter and the External reset parameter.
If you clear the Show enable port check box and
you set External reset to None,
the decision count is 0. If you select Show enable port and you set
External reset to None, the
decision count is 1. If you clear the Show enable port check box and
you set External reset to a value other than
None, the decision count is 1. If you select Show enable port and you set
External reset to a value other than
None, the decision count is 2.
|
| Enabled and Triggered Model or Subsystem | 1 | For the decision count, a model or subsystem that is enabled and
triggered can be treated as an if-else statement:
If the model or subsystem is enabled and triggered, the model or
subsystem executes. Otherwise, by default, the model or subsystem does not execute.
An if-else statement has a
decision count of 1 because the if statement represents one
decision and the else statement represents the default
behavior (no decisions made). |
| Enabled Model or Subsystem | 1 | For the decision count, a model or subsystem that is enabled can be
treated as an if-else statement:
If the model or subsystem is enabled, the model or subsystem
executes. Otherwise, by default, the model or subsystem does not execute.
An if-else statement has a
decision count of 1 because the if statement represents one
decision and the else statement represents the default
behavior (no decisions made). |
| For Iterator Subsystem | 1 | For the decision count, the For Iterator Subsystem block
can be treated as an if-else statement:
If the iteration value is less than or equal to the iteration limit,
iterate over blocks in the For Iterator Subsystem
block. Otherwise, the subsystem does not execute.
An if-else statement has a
decision count of 1 because the if statement represents one
decision and the else statement represents the default
behavior (no decisions made). |
| If | Number of if and elseif
expressions | Each if statement represents a decision and each
elseif statement represents a decision. The
decision count is the number of if and
elseif statements. For example, the following
code contains one if statement and one
elseif statement and therefore has a decision count of
2: |
| Index Vector | 1 | The Index Vector block is associated with a decision
count of 1. The Index Vector block is a special
configuration of the Multiport Switch block in which you specify
one data input and the control input is zero-based. For example, if
the input vector is [18 15 17 10] and the control input is
3 (zero-based index), the output is 10.
Using the control input to index into the input vector is considered a single
decision. |
| MinMax | Either 1 or the number of input ports minus 1 | The decision count depends on the number of input ports:
If the number of input ports is 1, then the decision count is
1. Otherwise, the decision count is the number of input ports minus
1.
|
| Multiport Switch | Number of data ports minus 1 | The decision count for the Multiport Switch block
depends on the number of data ports that are inputs to the block. The number of
data ports represents the number of possible outcomes. The decision
count is the number of data ports minus 1 because one of the possible outcomes
is the default path. For the default path, no decision was made. For
example, if the number of data inputs is 3, then the decision count is
2. If there is only one data port, the Multiport
Switch block acts as an Index Vector block and has a
decision count of 1. |
| Rate Limiter | 2 | The output of the Rate Limiter block is determined by
comparing rate to the Rising slew rate
(R) and Falling slew rate
(F) parameters. For the decision count, the
Rate Limiter block can be treated as an
if-elseif-else statement:
If rate is greater than R, the
output is calculated using the rising slew rate. If rate is less than F, the
output is calculated using the falling slew rate. Otherwise, the rate is between the bounds of
R and F and the change in output
is equal to the change in input.
An if-elseif-else statement has a
decision count of 2 because the if statement represents one
decision, the elseif statement represents one decision, and
the else statement represents the default behavior (no
decisions made). |
| Relay | 2 | The output of the Relay block is determined by the
Switch off point and the Switch on
point parameters. For the decision count, the
Relay block can be treated as an
if-elseif-else statement:
If the relay is on, the output remains on until the input drops below
the value of the Switch off point parameter. If the relay is off, the output remains off until the input exceeds
the value of the Switch on point parameter. Otherwise, the input falls between the Switch off
point and the Switch on point and the
output is unchanged.
An if-elseif-else statement has a
decision count of 2 because the if statement represents one
decision, the elseif statement represents one decision, and
the else statement represents the default behavior (no
decisions made). |
| Saturation | 2 | The output of the Saturation block is determined by
comparing the input to the Upper limit and Lower
limit parameters. For the decision count, the
Saturation block can be treated as an
if-elseif-else statement:
If the input is less than the Lower limit, the
output is the value of the Lower limit. If the input is greater than the Upper limit, the
output is the value of the Upper limit. Otherwise, the output is the value of the input.
An if-elseif-else statement has a
decision count of 2 because the if statement represents one
decision, the elseif statement represents one decision, and
the else statement represents the default behavior (no
decisions made). |
| Send | Either 0 or 1 | The decision count depends on the Show enable port
parameter.
If you clear the Show enable port check box, the
decision count is 0. If you select Show enable port, the decision
count is 1.
|
| Sign | 2 | The output of the Sign block is determined by the
input. For the decision count, the Sign block can be
treated as an if-elseif-else statement:
If the input is negative, the output is negative 1. If the input is positive, the output is positive 1. Otherwise, the output is 0.
An if-elseif-else statement has a
decision count of 2 because the if statement represents one
decision, the elseif statement represents one decision, and
the else statement represents the default behavior (no
decisions made). |
| Switch | 1 | The Switch block is associated with a decision count of 1:
If input 2 (the control input) satisfies the selected criterion, the
output is equal to input 1. Otherwise, the output is equal to input 3.
For example, the following code shows a decision
count of 1: |
| Switch Case | Number of outports minus 1 | The default case represents the default behavior (no
decisions made). But each subsequent case represents a
decision. The decision count is the number of outports minus
1. For example, the following code represents a Switch
Case block with 3 outputs and has a decision count of
2: |
| Triggered Model or Subsystem | 1 | For the decision count, a model or subsystem that is triggered can be
treated as an if-else statement:
If the model or subsystem is triggered, the model or subsystem
executes. Otherwise, by default, the model or subsystem does not execute.
An if-else statement has a
decision count of 1 because the if statement represents one
decision and the else statement represents the default
behavior (no decisions made). |
| Trigonometric Function | 0 or 3 | The decision count depends on the Function
parameter and the Remove protection against out-of-range
input parameter.
If you set the Function parameter to
asin or acos and you clear the
Remove protection against out-of-range input
checkbox, the decision count is 3. Otherwise, the decision count is 0.
|
| While Iterator Subsystem | 1 | For the decision count, the While Iterator Subsystem
block can be treated as an if-else statement:
If the value of the input condition is true or
1, execute the contents of the subsystem. Otherwise, the subsystem does not execute.
An if-else statement has a
decision count of 1 because the if statement represents one
decision and the else statement represents the default
behavior (no decisions made). |