%% Decode SL-SCH Transport Channel and Check CRC
% Encode and decode an information block using the SL-SCH transport channel, and display the CRC error result.
% Create a UE settings structure. Generate a 100-bit transport block and SL-SCH codeword.

ue = struct('CyclicPrefixSL','Normal','Modulation','16QAM','RV',0);
trblk = randi([0 1],100,1);
cw = lteSLSCH(ue,5760,trblk);

%
% Decode the SL-SCH codeword and check for block errors.

[rxtrblk,err] = lteSLSCHDecode(ue,length(trblk),cw);
err

% The decoded transport block has no errors.
% Copyright 2012 The MathWorks, Inc.