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: icatb_percent_variance.m
    path of file: ./repos/bspm/thirdparty/MIALAB/GroupICATv4.0a/icatb/icatb_helper_functions
    
    the code of the file until where you have to start completion: function total_percent_variance  = icatb_percent_variance(param_file)
%% Use regression to get explained percent variance in the data by the model
% where components are treated as model.
%

    
function total_percent_variance  = icatb_percent_variance(param_file)
%% Use regression to get explained percent variance in the data by the model
% where components are treated as model.
%
% Inputs:
% 1. param_file - Parameter file.
%
% Outputs:
% 1. percent_variance - Percent variance

global PARAMETER_INFO_MAT_FILE;

%% Load parameter and validate parameter file
filterP = ['*', PARAMETER_INFO_MAT_FILE, '*.mat'];

if ~exist('param_file', 'var')
    param_file = icatb_selectEntry('typeEntity', 'file', 'title', 'Select Parameter File', 'filter', filterP);
end