You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: pmiType1SinglePanelCodebook.m
    path of file: ./repos/5G_based_System_level_Integrated_Sensing_and_Communication_Simulator/+communication
    
    the code of the file until where you have to start completion: function  W = pmiType1SinglePanelCodebook(reportConfig,nLayers)
%   W = pmiType1SinglePanelCodebook(REPORTCONFIG,NLAYERS) returns type-1
%   single panel precoder matrices W, as defined in TS 38.214 Tables
%   5.2.2.2.1-1 to 5.2.2.2.1-12 by considering the following inputs:
%
%   REPORTCONFIG is a CSI reporting configuration structure with the
%   following fields:
%      PanelDimensions            - Antenna pannel configuration as a
%                                   two-element vector ([N1 N2]). It is
%                                   not applicable for CSI-RS ports less
%                                   than or equal to 2
%      OverSamplingFactors        - DFT oversampling factors corresponds to
%                                   the panel configuration
%      CodebookMode             
    
function [vlmRestricted,i2Restricted] = isRestricted(codebookSubsetRestriction,bitIndex,n,i2Restriction)
%   [VLMRESTRICTED,I2RESTRICTED] = isRestricted(CODEBOOKSUBSETRESTRICTION,BITINDEX,N,I2RESTRICTION)
%   returns the status of vlm or vbarlm restriction and i2 restriction for
%   a codebook index set, as defined in TS 38.214 Section 5.2.2.2.1 by
%   considering the following inputs:
%
%   CODEBOOKSUBSETRESTRICTION - Binary vector for vlm restriction
%   BITINDEX                  - Bit index (0-based) associated with all the
%                               precoders based on vlm
%   N                         - Co-phasing factor index
%   I2RESTRICTION             - Binary vector for i2 restriction

    % Get the restricted index positions from the codebookSubsetRestriction
    % binary vector
    restrictedIdx = reshape(find(~codebookSubsetRestriction)-1,1,[]);
    vlmRestricted = false;
    if any(sum(restrictedIdx == bitIndex(:),2))
        vlmRestricted = true;
    end