%% Decode Format 0 SCI Message Using UE Settings
% Decode an SCI format 0 message using UE settings. Encode a bit vector representing an SCI information payload, and then decode and error-check the result. Use a UE settings structure to create and encode an SCI message.
% Create a UE settings structure with 5 MHz bandwidth and extended cyclic prefix length. Generate and encode an SCI format 0 message.

ue = struct('NSLRB','5MHz','CyclicPrefixSL','Extended');

[~,sciBits] = lteSCI(ue);
cw = lteSCIEncode(ue,sciBits);

%
% Decode the SCI message payload bit vector, cw. Use the UE settings structure to determine the SCI message length.

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

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