%% Generate and Map PDCCH Symbols to Carrier Grid
% Configure the carrier and the PDCCH with default configuration parameters.

carrier = nrCarrierConfig;
pdcch = nrPDCCHConfig;

%  Generate PDCCH symbols for a random DCI codeword by using PDCCH configuration parameters for scrambling and identifying the UE.

dciCW = randi([0 1],864,1);
sym = nrPDCCH(dciCW,pdcch.DMRSScramblingID,pdcch.RNTI);

% Generate PDCCH resource element indices by using the specified carrier and PDCCH objects.

ind = nrPDCCHResources(carrier,pdcch);

% Create a grid for mapping PDCCH symbols to the grid.

cgrid = zeros(12*carrier.NSizeGrid,carrier.SymbolsPerSlot);

% Map PDCCH symbols to the grid.

cgrid(ind) = sym;

% Copyright 2019 The MathWorks, Inc.