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: cell2txtfile.m
    path of file: ./repos/GIBBON/lib
    
    the code of the file until where you have to start completion: function cell2txtfile(varargin)

% function cell2txtfile(fileName,T,skipOpt,checkChar)
% ------------------------------------------------------------------------
%
% This function exports the content in the cell array T to
% the text file fileName. Each entry in the cell array will be a line in
% the txt file. Prior to text file creation the cell is converted to a
% column format. If the input skipOpt=1 cell entries which appear empty
% (after spaces are removed) will be skipped.
%
% Kevin Mattheus Moerman
% gibbon.toolbox@gmail.com
%

    
function cell2txtfile(varargin)

% function cell2txtfile(fileName,T,skipOpt,checkChar)
% ------------------------------------------------------------------------
%
% This function exports the content in the cell array T to
% the text file fileName. Each entry in the cell array will be a line in
% the txt file. Prior to text file creation the cell is converted to a
% column format. If the input skipOpt=1 cell entries which appear empty
% (after spaces are removed) will be skipped.
%
% Kevin Mattheus Moerman
% gibbon.toolbox@gmail.com
%
% Change log: 
% 2016/09/09: Updated for GIBBON
% 2016/09/09: Added conversion to char and associated warning for non-character content. 
% 2018/02/14: Added whole cell conversion when skipOp==0
% 2018/02/14: Added varargin and defaults
%
% To do: 
% * Proper handling of conversion of non-character entries (e.g. have user
% specify conversion format to use for numerical data). 
%------------------------------------------------------------------------

%% parse input

switch nargin
    case 2
        fileName=varargin{1};
        T=varargin{2};
        skipOpt=0;   
        checkChar=1;
    case 3
        fileName=varargin{1};
        T=varargin{2};
        skipOpt=varargin{3};
        checkChar=1;
    case 4
        fileName=varargin{1};
        T=varargin{2};
        skipOpt=varargin{3};
        checkChar=varargin{4};
end

% Force column if it isn't
if ~isvector(T)
    T=T(:);%Make column
end