DSP Blockset | ![]() ![]() |
Alter the input size by zero-padding or truncating rows and/or columns.
Library
Description
The Zero Pad block changes the size of the input matrix from Mi-by-Ni to Mo-by-No by zero-padding or truncating along the rows, the columns, or both dimensions. The dimensions of the output, Mo and No, are specified by the Number of output rows and Number of output columns parameters, respectively.
The Zero pad along parameter specifies how the input should be altered. The options are:
When Columns is selected, the Number of output rows parameter (Mo) is enabled, and the block pads or truncates each input column by an equal amount. If Mo>Mi, the block pads by adding Mo-Mi rows of zeros to the bottom of the matrix. If Mo<Mi, the block truncates by deleting Mi-Mo rows from the bottom of the matrix. In both cases, the number of columns is unchanged (No=Ni). A 1-D vector input is zero padded or truncated at the "bottom," and the output is a 1-D vector.
When Rows is selected, the Number of output columns parameter (No) is enabled, and the block pads or truncates each input row by an equal amount. If No>Ni, the block pads by adding No-Ni columns of zeros to the right side of the matrix. If No<Ni, the block truncates by deleting Ni-No columns from the right side of the matrix. In both cases, the number of rows is unchanged (Mo=Mi). A 1-D vector input is zero padded or truncated at the "bottom," and the output is a 1-D vector.
When Columns and rows is selected, both the Number of output rows parameter (Mo) and the Number of output columns parameter (No) are enabled, and the block pads or truncates rows and columns as specified. A length-Mi 1-D vector input is treated as an Mi-by-1 matrix and the output is an Mo-by-No matrix.
When None is selected, the input is passed through to the output without padding or truncation.
Example
In the model below, the 3-by-3 input is zero-padded along the column dimension to 5-by-3. The parameter settings in the Zero Pad block are:
Dialog Box
See Also
Matrix Concatenation |
Simulink |
Pad |
DSP Blockset |
Repeat |
DSP Blockset |
Submatrix |
DSP Blockset |
Upsample |
DSP Blockset |
Variable Selector |
DSP Blockset |
![]() | Yule-Walker Method | DSP Function Reference | ![]() |