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: grClose.m
    path of file: ./repos/matGeom/matGeom/graphs
    
    the code of the file until where you have to start completion: function varargout = grClose(varargin)
%GRCLOSE Morphological closing on graph.
%

    
function varargout = grClose(varargin)
%GRCLOSE Morphological closing on graph.
%
%   LBL2 = grClose(EDGES, LBL1)
%   First performs dilatation, then erosion.
%
%   Example
%   grOpen
%
%   See also 
%

% ------
% Author: David Legland
% E-mail: david.legland@inrae.fr
% Created: 2006-01-20
% Copyright 2006-2023 INRA - CEPIA Nantes - MIAJ (Jouy-en-Josas)

if length(varargin) == 2
    edges   = varargin{1};
    lbl     = varargin{2};
elseif length(varargin) == 3
    edges   = varargin{2};
    lbl     = varargin{3};
else
    error('Wrong number of arguments in "grOpen"');
end