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_OutputMatlabVariables.m
    path of file: ./repos/CBIG/utilities/matlab/utilities
    
    the code of the file until where you have to start completion: function CBIG_OutputMatlabVariables(matlab_data_file, eval_string, output_txt_file, prefix_string)

% Output a matlab variable to a text file.

    
function CBIG_OutputMatlabVariables(matlab_data_file, eval_string, output_txt_file, prefix_string)

% Output a matlab variable to a text file.
% 
%   CBIG_OutputMatlabVariables(matlab_data_file, eval_string, output_txt_file, prefix_string)
%   Input: 
%       matlab_data_file    : a mat file
%       eval_string         : variable that you want to output
%       output_txt_file     : output text file
%       prefix_string       : prefix before the variable in text file
%   Example:
%   CBIG_OutputMatlabVariables('something.mat', 'metrics.nodal_pathlengths', 'tmp.txt', prefix_string) 
%
% Written by CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md


load(matlab_data_file);

variable = eval(eval_string);
fid = fopen(output_txt_file, 'w');

if(nargin == 4)
    fprintf(fid, '%-40s = %-12.5f\n', prefix_string, variable);
else
    fprintf(fid, '%-12.5f\n', variable);
end