%% View SCI Message Field Sizes
% Create a format 0 SCI message structure. Use the opts input to view the message field sizes and to exclude fields with zero length.
% Create a UE settings structure.

ue = struct('NSLRB','5MHz');
opts = {'fieldsizes','excludeunusedfields'}

%
% Generate an SCI message and view the field sizes of the returned SCI message structure contents.

[sci0,bits] = lteSCI(ue,opts);
sci0
allocfields = sci0.Allocation

%
% Inspect the returned structure to see the bit length of each field in the SCI message.

fieldsLength = sci0.FreqHopping + sci0.Allocation.RIV + ...
    sci0.TimeResourcePattern + sci0.ModCoding + sci0.TimeAdvance + ...
    sci0.NSAID
bitsLength = size(bits,1)
isequal(fieldsLength,bitsLength)

% The sum of the field sizes matches the length of the returned bits output.
% Copyright 2012 The MathWorks, Inc.