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: erplab_print2file.m
    path of file: ./repos/erplab/functions
    
    the code of the file until where you have to start completion: % Mofified version of the original SAVE2PDF of Gabe Hoffmann (gabe.hoffmann@gmail.com)
%
% Saves a figure as a properly cropped pdf, eps, jpeg, or tiff
%
%   save2pdf(
    
function erplab_print2file(FileName, fformat, handle, dpi)

% Verify correct number of arguments
matlab_v = version('-release');
matlab_v = str2double(matlab_v(1:4));

if matlab_v > 2012
    narginchk(0,4)
else
    error(nargchk(0,4,nargin))
end