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: vl_plotgrid.m
    path of file: ./repos/panorama/lib/vlfeat-0.9.20/toolbox/plotop
    
    the code of the file until where you have to start completion: function h=vl_plotgrid(x,y,varargin)
% VL_PLOTGRID  Plot a 2-D grid
%  VL_PLOTGRID(X,Y) plots a grid with vertices (X,Y). X and Y are MxN
%  matrices, with one entry per vertex.
%
%  H=VL_PLOTGRID(...) returns the handle to the grid object.
%
%  See also: VL_HELP().

washold = ishold ;

[M,N] = size(x) ;

hold on ;

xh = [x' ; nan*ones(1,M) ] ;
yh = [y' ; nan*ones(1,M) ] ;

xh = xh(:) ;
yh = yh(:) ;

xv = [x ; nan*ones(1,N) ] ;

    
function h=vl_plotgrid(x,y,varargin)
% VL_PLOTGRID  Plot a 2-D grid
%  VL_PLOTGRID(X,Y) plots a grid with vertices (X,Y). X and Y are MxN
%  matrices, with one entry per vertex.
%
%  H=VL_PLOTGRID(...) returns the handle to the grid object.
%
%  See also: VL_HELP().

washold = ishold ;

[M,N] = size(x) ;

hold on ;

xh = [x' ; nan*ones(1,M) ] ;
yh = [y' ; nan*ones(1,M) ] ;

xh = xh(:) ;
yh = yh(:) ;

xv = [x ; nan*ones(1,N) ] ;
yv = [y ; nan*ones(1,N) ] ;

xv = xv(:) ;
yv = yv(:) ;

lineprop = {} ;
if length(varargin) > 0
  lineprop = vl_linespec2prop(varargin{1}) ;
  lineprop = {lineprop{:}, varargin{2:end