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: coeffs2iis.m
    path of file: ./repos/spm12/external/fieldtrip/connectivity/private
    
    the code of the file until where you have to start completion: function iis = coeffs2iis(A,C)

% COEFFS2IIS computes the instantaneous interaction strength based on the
% MVAR-coefficients and a noise covariance matrix. The underlying
% assumption is that the MVAR-models have been fitted in a bivariate
% fashion. It uses the definition according to Vinck et al. Neuroimage 2015
% (108).
%
% Input data:
%   A = 2x2xncmbxorder, matrix with MVAR-coefficients
%   C = 2x2xncmb      , covariance matrices of the noise

siz  = [size(C) 1];
ncmb = siz(3);

P1 = repmat(eye(2), [1 1 ncmb]);
P2 = repmat(eye(2), [1 1 ncmb]);

% deciphering some code from Martin Vinck, this swaps the indices in the
% denominator w.r.t. the other (i.e. my implementation from the paper)

% projection matrices
P1(2,1,:) = -C(1,2,:)./C(1,1,:);
P2(1,2,:) = -C(2,1,:)./C(2,2,:);

    
function iis = coeffs2iis(A,C)

% COEFFS2IIS computes the instantaneous interaction strength based on the
% MVAR-coefficients and a noise covariance matrix. The underlying
% assumption is that the MVAR-models have been fitted in a bivariate
% fashion. It uses the definition according to Vinck et al. Neuroimage 2015
% (108).
%
% Input data:
%   A = 2x2xncmbxorder, matrix with MVAR-coefficients
%   C = 2x2xncmb      , covariance matrices of the noise

siz  = [size(C) 1];
ncmb = siz(3);

P1 = repmat(eye(2), [1 1 ncmb]);
P2 = repmat(eye(2), [1 1 ncmb]);

% deciphering some code from Martin Vinck, this swaps the indices in the
% denominator w.r.t. the other (i.e. my implementation from the paper)

% projection matrices
P1(2,1,:) = -C(1,2,:)./C(1,1,:);
P2(1,2,:) = -C(2,1,:)./C(2,2,:);

B12 = A;
B21 = A;
for k = 1:size(A,4)
  B12(:,:,:,k) = mtimes2x2(P1,A(:,:,:,k));
  B21(:,:,:,k) = mtimes2x2(P2,A(:,:,:,k));
end