%% Decode Format 0 SCI Message
% Decode an SCI format 0 message given the SCI message length. Use the length of an SCI format 0 message, determined using the lteSCIInfo function, to create and encode an SCI message.
% Create a UE settings structure with 10-MHz bandwidth and normal cyclic prefix length.

ue = struct('NSLRB',50,'CyclicPrefixSL','Normal');

%
% Determine the SCI message length with the lteSCIInfo function. Encode the SCI message.

sciInfo = lteSCIInfo(ue);
scilen = sciInfo.Format0;
sciBits = zeros(scilen,1);
cw = lteSCIEncode(ue,sciBits);

%
% Decode the SCI message payload bit vector.

[sciBits,crcErr] = lteSCIDecode(scilen,cw);
crcErr

% The cyclic redundancy check returns a zero, indicating that the decoded SCI message has no errors.
% Copyright 2012 The MathWorks, Inc.