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: ufd_sumRect.m
    path of file: ./repos/ufpa-face-detection
    
    the code of the file until where you have to start completion: function PixelSum=ufd_sumRect(IntegralImage,x,y,Width,Height)
% This function returns the sum of pixels inside a rectangle, using the integral
% image structure to simplify calculations.
% Inputs: integral image representation and a rectangle defined by the upperleft
% point (x,y) and its width w and height h. The inputs x,y,Width,Height
% can also be arrays. In this case, PixelSum is an array with the
% output for each (x,y,w,h).
% (Based on code by D. Kroon)%
% PixelSum=GetSumRect(IntegralImage,x,y,Width,Height)
%

global debugme; %global variable that is 1 if debugging with a small image


    
function PixelSum=ufd_sumRect(IntegralImage,x,y,Width,Height)
% This function returns the sum of pixels inside a rectangle, using the integral
% image structure to simplify calculations.
% Inputs: integral image representation and a rectangle defined by the upperleft
% point (x,y) and its width w and height h. The inputs x,y,Width,Height
% can also be arrays. In this case, PixelSum is an array with the
% output for each (x,y,w,h).
% (Based on code by D. Kroon)%
% PixelSum=GetSumRect(IntegralImage,x,y,Width,Height)
%

global debugme; %global variable that is 1 if debugging with a small image

%force Width and Height to have the same dimension as x
%because the current code sometimes calls this function with
%Width and Height being scalars and other times vectors.
if length(x) ~= length(Height)
    Height=Height*ones(size(x));
    Width=Width*ones(size(x));
end