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: printBLAMatrix.m
    path of file: ./repos/AutomationShield/matlab
    
    the code of the file until where you have to start completion: %   Function used to save MATLAB matrices into a header file in a format
%   compatible 
    
function printBLAMatrix(varargin)
% Check if at least two input arguments were provided
if nargin < 2
    error('Not enough input arguments provided. Function expects at least two arguments - printBLAMatrix(matrix,''matrixName'').')
end

% Check whether even or odd number of input arguments were provided 
% to figure out whether the user provided a custom header fileName
if ~mod(nargin, 2)
    fileName = 'BLA_Matrices';    % Use default header file name
    nOfPairs = nargin / 2;
else
    fileName = varargin{nargin};  % Use provided header file name
    nOfPairs = (nargin - 1) / 2;
end

% Clear the file and open it for writing, print AutomationShield title
fileHandle = fopen([fileName, '.h'], 'w');
fprintf(fileHandle, '// Header file storing BLA class matrices for Arduino IDE examples.\n');
fprintf(fileHandle, '// Automatically generated by the AutomationShield library.\n');
fprintf(fileHandle, '// Visit www.automationshield.com for more information.\n');
fprintf(fileHandle, '// ================================================================\n');
fprintf(fileHandle, '\n');

% Print all of the individual pairs matrix-'matrixName' into the header
% folder, in the correct format abiding BLA library and Arduino IDE rules 
for n = 1:nOfPairs
    matrix = varargin{2*n-1};
    matrixName = varargin{2*n};
    matrixSize = size(matrix);
    vector = matrix';
    vector = vector(:)';
    vector = round(vector, 5);
    fprintf(fileHandle, 'BLA::Matrix<%d, %d> %s%s', matrixSize(1), matrixSize(2), matrixName, ' = {');
    for i = 1:length(vector)
        fprintf(fileHandle, '%.5g', vector(i));
        if i < length(vector)
            fprintf(fileHandle, '%s', ', ');
        end