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: histcImLoc.m
    path of file: ./repos/toolbox/images
    
    the code of the file until where you have to start completion: function 
    
function
% is [nBins x nMasks], and for example if nd==2 the output is [nBins x
% nBins x nMasks].  If nd is large computing the histograms is time
% consuming.
%
% USAGE
%  h = histcImLoc( I, edges, parMask, [wtMask], [multCh] )
%
% INPUTS
%  I           - M1xM2x...xMkxnd array, (nd channels each of M1xM2x...xMk)
%  edges       - quantization bounds, see histc2
%  parMask     - cell of parameters to maskGaussians
%  wtMask      - [] M1xM2x...xMk numeric array of weights
%  multCh      - [0] if 1 last dimension of I is number of channels
%
% OUTPUTS
%  h           - nd-histograms [nBins^nd x nMasks]
%
% EXAMPLE - multCh==0
%  I = filterGauss([100 100],[],[],0);
%  h = histcImLoc(I,10,{2,.6,.1,1},[],0);
%  figure(1); im(h)
%
% EXAMPLE - multCh==1
%  I = filterGauss([100 100],[],[],0);
%  h1 = histcImLoc( cat(3,I,I), 10, {2,.6,.1,0},[],1);
%  h2 = histcImLoc( cat(3,I,randn(size(I))),10,{2,.6,.1,0},[],1);
%  figure(1); montage2(h1); figure(2); montage2(h2);
%
% See also HISTC2, MASKGAUSSIANS, ASSIGNTOBINS, HISTCIMWIN
%
% Piotr's Computer Vision Matlab Toolbox      Version 2.0
% Copyright 2014 Piotr Dollar.  [pdollar-at-gmail.com]
% Licensed under the Simplified BSD License [see external/bsd.txt]

if( nargin<4 ); wtMask=[]; end