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: ce_savefigure.m
    path of file: ./repos/CellExplorer/calc_CellMetrics
    
    the code of the file until where you have to start completion: function ce_savefigure(fig,savePathIn,fileNameIn,dispSave,saveFig1)
    % saveFig.path [1=summaryFigures,2=withCellExplorer,3=custom]
    % saveFig.fileFormat [1=png,2=pdf]
    if nargin < 4
        dispSave = false;
    end
    if nargin < 5
        saveFig1.save = 1;

    
function ce_savefigure(fig,savePathIn,fileNameIn,dispSave,saveFig1)
    % saveFig.path [1=summaryFigures,2=withCellExplorer,3=custom]
    % saveFig.fileFormat [1=png,2=pdf]
    if nargin < 4
        dispSave = false;
    end
    if nargin < 5
        saveFig1.save = 1;
        saveFig1.path = 1; 
        saveFig1.fileFormat = 1; 
    end
    
    if saveFig1.save
        if saveFig1.path == 1
            savePath = fullfile(savePathIn,'summaryFigures');
            if ~exist(savePath,'dir')
                mkdir(savePathIn,'summaryFigures')
            end