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: MinMaxDataExtents2d.m
    path of file: ./repos/CutAndDisplace/SharedFunctions
    
    the code of the file until where you have to start completion: function [maxgriX,mingriX,maxgriY,mingriY,size]=MinMaxDataExtents2d(points,cells,padding)
% MinMaxDataExtents2d: Creates limits of data for use in the function
%                   meshgrid. The limits are based on the xy limits of the
%                   input points and the resultant grid will be square,
%                   uniformly spaced in XY and have the number of cells
%                   defined by the input argument. Additional padding past
%                   the data limits can also be supplied.
%                   
%               
% usage #1:
% [maxgriX,mingriX,maxgriY,mingriY,size]=MinMaxDataExtents2d(points,cells,padding)
%
% Arguments: (input)
% Points           - XY locations of points in space. n*2 vector. 
%
% cells            - This creates gridded data, this defines how many
%                   cells span across the data extents. 
%
% padding          - The number of extra cells you would like away from the
%                   data limits (not distance). Using this means there will
%                   be more cells that defined in the input args. 
%
% Arguments: (output)
% maxgriX,mingriX
% maxgriY,mingriY  - Data limits for use in the meshgrid function. 
%

    
function [maxgriX,mingriX,maxgriY,mingriY,size]=MinMaxDataExtents2d(points,cells,padding)
% MinMaxDataExtents2d: Creates limits of data for use in the function
%                   meshgrid. The limits are based on the xy limits of the
%                   input points and the resultant grid will be square,
%                   uniformly spaced in XY and have the number of cells
%                   defined by the input argument. Additional padding past
%                   the data limits can also be supplied.
%                   
%               
% usage #1:
% [maxgriX,mingriX,maxgriY,mingriY,size]=MinMaxDataExtents2d(points,cells,padding)
%
% Arguments: (input)
% Points           - XY locations of points in space. n*2 vector. 
%
% cells            - This creates gridded data, this defines how many
%                   cells span across the data extents. 
%
% padding          - The number of extra cells you would like away from the
%                   data limits (not distance). Using this means there will
%                   be more cells that defined in the input args. 
%
% Arguments: (output)
% maxgriX,mingriX
% maxgriY,mingriY  - Data limits for use in the meshgrid function. 
%
% size             - Step size for use in the meshgrid function. 
%
% Example usage:
% 
% % Create a diagonal line that extend