(To be removed) Distribute input elements in output vector
The Insert Zero block constructs an output vector by inserting zeros among the elements of the input vector. The input signal can be real or complex. Both the input signal and the Insert zero vector parameter are column vector signals. The number of 1s in the Insert zero vector parameter must be evenly divisible by the input data length. If the input vector length is greater than the number of 1s in the Insert zero vector parameter, then the block repeats the insertion pattern until it has placed all input elements in the output vector.
The block determines where to place the zeros by using the Insert zero vector parameter.
For each 1 the block places the next element of the input vector in the output vector
For each 0 the block places a 0 in the output vector
The block accepts the following data types:
double, and fixed-point. The output
signal inherits its data type from the input signal.
To implement punctured coding using the Puncture and Insert Zero blocks, use the same vector for the Insert zero vector parameter in this block and for the Puncture vector parameter in the Puncture block.
A binary vector with a pattern of 0s and 1s that indicate where the block places either 0s or input vector elements in the output vector.
Not recommended starting in R2020a
Insert Zero will be removed in a future release. Use MATLAB code in a MATLAB Function block instead.
This code can be used in a MATLAB Function block to insert zeros into a data stream.
function y = fcn(u,insertZeroVector) numSeg = length(u)/sum(insertZeroVector); c = zeros(length(insertZeroVector), numSeg,'like',u); c(logical(insertZeroVector),:) = reshape(u,,numSeg); y = c(:); end
For an example using this code, see Insert Zeros into a Random Number Stream.