%% Generate PDCCH Indices for All Candidates and Aggregation Levels
% Configure the carrier and the PDCCH with default configuration parameters.

carrier = nrCarrierConfig;
pdcch = nrPDCCHConfig;

% Generate all PDCCH resource element indices for all candidates and aggregation levels.

allInd = nrPDCCHSpace(carrier,pdcch)

% Verify that the number of generated candidates for the PDCCH indices at each aggregation level matches the number of candidates specified by the default search space set.

numCandidates = [...
    size(allInd{1},2) ... 
    size(allInd{2},2) ... 
    size(allInd{3},2) ... 
    size(allInd{4},2) ... 
    size(allInd{5},2)];
isequaln(pdcch.SearchSpace.NumCandidates,numCandidates)

% Copyright 2019 The MathWorks, Inc.