%helperPlotTransmitResourceGrid Helper function
%
% This file is for internal use only and may change in a future release of
% MATLAB.

% Copyright 2013-2017 The MathWorks, Inc.

function helperPlotTransmitResourceGrid(enb,grid)
                
    % Create patches (outside of final view) to facilitate the creation 
    % of the legend
    hold on;
    for i=1:9
        patch([-2 -3 -3 -2],[-2 -2 -3 -3],i);
    end            
    
    % Obtain resource grid colorization
    colors = helperIdentifyDLChannels(enb,grid);
    
    % Plot resource grid
    helperPlotResourceGrid(abs(grid),colors);
    
    % Add plot title and set view
    title('Transmitted resource grid');
    view([0 90]);
    
    % Add legend
    legend('unused','Cell RS','PSS','SSS','PBCH','PCFICH','PHICH', ...
            'PDCCH','PDSCH','Location','NorthEastOutside');

end