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: cropandResizeMasks.m
    path of file: ./repos/mask-rcnn/src/+helper
    
    the code of the file until where you have to start completion: function [ outputMasks ] = cropandResizeMasks (gTruthMasks, gTruthBoxes, outputSize)

% gTruthMasks - HxWxnumObjects
% gTruthBoxes - numObjectsx4

    
function [ outputMasks ] = cropandResizeMasks (gTruthMasks, gTruthBoxes, outputSize)

% gTruthMasks - HxWxnumObjects
% gTruthBoxes - numObjectsx4
% outputSize - [h' w']
% outputMasks - h'x w' x numObjects

% Copyright 2020 The MathWorks, Inc.

% Loop through the gtruth boxes and crop corresponding mask instance

for i = 1:length(gTruthMasks)

    numObjects = size(gTruthBoxes{i},1);
    outputMasks{i} = zeros([outputSize numObjects], 'single');

    for j=1:numObjects

        croppedMask = imcrop(gTruthMasks{i}(:,:,j), gTruthBoxes{i}(j,:));

        outputMasks{i}(:,:,j) = imresize(croppedMask, outputSize, 'nearest');

    end