%% Encode DCI Rate Matching Output Length
% Perform DCI processing on an all-zero input. Set the output length to 100 bits.
% Define enb with 50 downlink RBs, 1 cell-specific reference signal antenna port, and FDD duplex mode. Use lteDCIInfo to determine DCI message lengths for the defined configuration. Generate a dcibits input vector with zeros for a format 1 DCI message.

enb = struct('NDLRB',50,'CellRefP',1,'DuplexMode','FDD');
dciInfo = lteDCIInfo(enb);
dcibits = zeros(dciInfo.Format1,1);

%
% Define a ue parameter structure with PDCCH format 1 and RNTI set to 0.

ue = struct('PDCCHFormat',1,'RNTI',0);

%
% Encode the DCI bits.

cw1 = lteDCIEncode(ue,dcibits);
size(cw1)

%
% Encode the DCI bits again, setting the output length to 100 bits.

cw2 = lteDCIEncode(ue,dcibits,100);
size(cw2)

% The output vector length for cw2 is 100, rather than the encoded PDCCH format 1 length of 144 bits in cw1, as expected for the configuration.
% Copyright 2012 The MathWorks, Inc.