Specify how to align the data types of input data to form the
uint8
vector output in bytes. Alignment can occur on 1, 2, 4, or
8-byte boundaries. Based on the alignment value, each signal data value begins on
multiples of the alignment value. The alignment algorithms for each element in the
output vector begin on a byte boundary specified by the alignment value. Byte alignment
sets the boundaries relative to the starting point of the vector.
To get the tightest packing without holes between data types in the various
combinations of data types, select 1
.
You can have multiple data types of varying lengths. In such cases, a 2-byte
alignment can produce 1–byte gaps between uint8
or
int8
values and another data type. In the pack implementation, the
block copies data to the output data buffer 1 byte at a time.
For example, assume that you specify this cell array for Input port data
types (cell array):
{'uint32','uint32','uint16','double','uint8','double','single'}
Assume that you set Byte alignment to 2
.
Each new value begins 2 bytes from the previous data boundary. When the signals are
scalar values, the:
First signal value in the vector starts at 0 bytes.
Second signal value starts at 2 bytes.
Third signal value starts at 4 bytes.
Fourth signal value starts at 6 bytes.
Fifth signal value starts at 8 bytes.
Sixth signal value starts at 10 bytes
Seventh signal value starts at 12 bytes.
The packing algorithm leaves a 1-byte gap between the uint8
data
value and the double value.