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: cat_progress_bar.m
    path of file: ./repos/cat12
    
    the code of the file until where you have to start completion: function cat_progress_bar(action,varargin)
% Display progress and remaining time with the same syntax as for spm_progress_bar
%
% FORMAT cat_progress_bar('Init', n_steps, process_name)
% Initialises progress tool
%
% FORMAT cat_progress_bar('Set',value)
% Sets iteration.
%
% FORMAT cat_progress_bar('Clear')
% Clears the progress window.
% ______________________________________________________________________
%
% Christian Gaser, Robert Dahnke
% Structural Brain Mapping Group (https://neuro-jena.github.io)
% Departments of Neurology and Psychiatry
% Jena University Hospital
% ______________________________________________________________________
% $Id$

persistent sum_time time_old n_iterations Fwaitbar progress_step

if ~nargin, action = 'Init'; end


switch lower(action)
    % Initialise
    %-------------------------------------------------------------------
    case 'init'

    
function cat_progress_bar(action,varargin)
% Display progress and remaining time with the same syntax as for spm_progress_bar
%
% FORMAT cat_progress_bar('Init', n_steps, process_name)
% Initialises progress tool
%
% FORMAT cat_progress_bar('Set',value)
% Sets iteration.
%
% FORMAT cat_progress_bar('Clear')
% Clears the progress window.
% ______________________________________________________________________
%
% Christian Gaser, Robert Dahnke
% Structural Brain Mapping Group (https://neuro-jena.github.io)
% Departments of Neurology and Psychiatry
% Jena University Hospital
% ______________________________________________________________________
% $Id$

persistent sum_time time_old n_iterations Fwaitbar progress_step

if ~nargin, action = 'Init'; end


switch lower(action)
    % Initialise
    %-------------------------------------------------------------------
    case 'init'
        n_iterations = varargin{1};
        if nargin > 2, arg2 = varargin{2}; else arg2 = 'Computing';  end
        
        sum_time = 0;
        time_old = clock;
        progress_step = 1;

        try
          Fwaitbar = waitbar(0,arg2,'Name',arg2);
        catch
          Fwaitbar = waitbar(0,arg2);
        end