You specify a matrix that defines all possible block outputs as the
Truth table parameter. Each row of the matrix
contains the output for a different combination of input elements. You must
specify outputs for every combination of inputs. The number of columns is
the number of block outputs.
The Truth table parameter can have Boolean values (0
or 1) of any data type, including fixed-point data types. If the table
contains non-Boolean values, the data type of the table must be
double
.
The relationship between the number of inputs and the number of rows
is:
number of rows = 2(number of
inputs)
Simulink® returns a row of the matrix by computing the row's index from
the input vector elements. Simulink computes the index by building a binary number where input
vector elements having zero values are 0 and elements having nonzero values
are 1, then adding 1 to the result. For an input vector,
u
, of m
elements:
row index = 1 +
u(m)*2
0 +
u(m-1)*2
1 + ... +
u(1)*2
m-1
Programmatic Use
Block Parameter:
TruthTable |
Type: character vector |
Values: matrix |
Default: '[0 0;0 1;0
1;1 0;0 1;1 0;1 0;1 1]' |