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: gendoc_PSI.m
    path of file: ./repos/spinw/tutorials/help
    
    the code of the file until where you have to start completion: function gendoc_PSI(fName, DirName)
% generates documentation files for uploading onto the PSI SpinW page
%
% GENDOC_PSI({fName},{DirName})
%
%

if nargin < 2
    % list of files in the publish folder:
    pubfolder = [sw_rootdir 'tutorials' filesep 'help'];
else

    
function gendoc_PSI(fName, DirName)
% generates documentation files for uploading onto the PSI SpinW page
%
% GENDOC_PSI({fName},{DirName})
%
%

if nargin < 2
    % list of files in the publish folder:
    pubfolder = [sw_rootdir 'tutorials' filesep 'help'];
else
    pubfolder = DirName;
end

if nargin == 0
    pubfiles  = dir([pubfolder filesep '*.m']);
else
    pubfiles  = dir([pubfolder filesep fName]);
end