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: CBIG_hMRF_build_prod_matrix.m
    path of file: ./repos/CBIG/stable_projects/brain_parcellation/Yan2023_homotopic/code/step1_generate_fmri_input
    
    the code of the file until where you have to start completion: function [lh_cov_mat, rh_cov_mat, dim] = CBIG_hMRF_build_prod_matrix(lh_input_file, rh_input_file,...
    lh_output_file, rh_output_file)
% CBIG_hMRF_build_prod_matrix(lh_input_file, rh_input_file, lh_output_file, rh_output_file)
%
% This function generates the premultiplied matrix with the input concatenated time series data.
%
% Input:
%   - <lh/rh>_input_filename: (char string)
%     The path to the input <lh/rh> concatenated time series file, generated by xx_gwMRF_build_time_matrix.
%
% Optional input:
%
%   - <lh/rh>_output_file: (char string)
%     The path to the output <lh/rh> premultiplied matrix file; if not provided, output matrices would not be saved.

    
function [lh_cov_mat, rh_cov_mat, dim] = CBIG_hMRF_build_prod_matrix(lh_input_file, rh_input_file,...
    lh_output_file, rh_output_file)
% CBIG_hMRF_build_prod_matrix(lh_input_file, rh_input_file, lh_output_file, rh_output_file)
%
% This function generates the premultiplied matrix with the input concatenated time series data.
%
% Input:
%   - <lh/rh>_input_filename: (char string)
%     The path to the input <lh/rh> concatenated time series file, generated by xx_gwMRF_build_time_matrix.
%
% Optional input:
%
%   - <lh/rh>_output_file: (char string)
%     The path to the output <lh/rh> premultiplied matrix file; if not provided, output matrices would not be saved.
%
% Output:
%   - <lh/rh>_multi_mat (matrix)
%     The NxN premultipled matrix for each hemisphere, respectively. N is the number of vertices on the given surface
%     mesh, excluding the medial wall vertices.
%
% Example:
%   CBIG_hMRF_build_prod_matrix('./lh_concat_timeseries.mat', './rh_concat_timeseries.mat',...
%   './output/lh_pmm.mat', './output/rh_pmm.mat')
%
% Written by Xiaoxuan Yan and CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md

if(~exist('lh_output_file', 'var'))
    warning('Output premultiplied matrices would not be saved.');
end