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: pinvNx2.m
    path of file: ./repos/bspm/thirdparty/spm12/external/fieldtrip/plotting/private
    
    the code of the file until where you have to start completion: function y = pinvNx2(x)


    
function [d] = inv2x2(x)

% INV2X2 computes inverse of matrix x, where x = 2x2xN, using explicit analytic definition

adjx  = [x(2,2,:,:) -x(1,2,:,:); -x(2,1,:,:) x(1,1,:,:)];
denom = x(1,1,:,:).*x(2,2,:,:) - x(1,2,:,:).*x(2,1,:,:);
d     = adjx./denom([1 1],[1 1],:,:);

function [z] = mtimes2xN(x, y)

% MTIMES2XN computes x*y where x = 2x2xM and y = 2xNxM
% and output dimensionatity is 2xNxM 

siz   = size(y);
z     = zeros(siz);

for k = 1:siz(2)
  z(1,k,:,:) = x(1,1,:,:).*y(1,k,:,:) + x(1,2,:,:).*y(2,k,:,:);
  z(2,k,:,:) = x(2,1,:,:).*y(1,k,:,:) + x(2,2,:,:).*y(2,k,:,:);
end