%% Layer Mapping and Demapping of Single Codeword
% Map a single codeword of length 20 to four transmission layers.

codeword = ones(20,1); 
nLayers = 4; 
layeredOut = nrLayerMap(codeword,nLayers);

% Recover the original codeword using layer demapping.

out = nrLayerDemap(layeredOut);

% Check for errors.

isequal(codeword,out{1})

% Copyright 2019 The MathWorks, Inc.