Here you can find my data: Link 1, Link 2
and my code:
D = X;
Lr = r;
% D = rand(10,5); %for random matrix, final result is matching
% Lr = rand(1,5);
B = eye(size(D,2))/(D'*D);
Dx = [D;Lr];
BLr = B-((B*Lr'*Lr*B)/(1+Lr*B*Lr')); % Row addition formula
Fr = Dx(1,:);
Dy = removerows(Dx,1);
BFr = BLr+ ((BLr*Fr'*Fr*BLr)/(1-Fr*BLr*Fr')); % row deletion formula
B1 = BFr;
D1 = Dy;
Dinv = B1*D1';
A1 = pinv(D1);