%% Allocate Type 1 Hopping PSSCH Subframe Pool PRBs
% Configure a type 1 hopping allocation of 3 PRBs. Display the PRB allocations that are associated with the sequence of subframes in a PSSCH subframe pool.
% Configure UE and SCI settings structures for a type 1 hopping allocation of 3 PRBs.

ue = struct('NSLRB',50);
sci = struct('FreqHopping',1);
sci.Allocation.RIV = 110;
sci.Allocation.HoppingBits = 1;

% Display an image of the PRBs used in each slot of each subframe in a pool of 10 PSSCH subframes.

subframeslots = zeros(ue.NSLRB,20);
for i = 0:9
    ue.NSubframePSSCH = i;
    prbSet = lteSCIResourceAllocation(ue,sci);
    prbSet = repmat(prbSet,1,2/size(prbSet,2));
    for s = 1:2
        subframeslots(prbSet(:,s)+1,2*i+s) = 20+s*20;
    end
end
imagesc(subframeslots)
axis xy
xlabel('PSSCH Subframe Pool')
ylabel('PRB Indices')

% Copyright 2012 The MathWorks, Inc.