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: alm.m
    path of file: ./repos/lrslibrary/algorithms/rpca/ALM
    
    the code of the file until where you have to start completion: %%
% The lansvd function can be downloaded here
% http://soi.stanford.edu/~rmunk/PROPACK/
function [A,E,tol_iter] = alm(D)

[n,p] = size(D);
kappa = 1.1;%can be tuned
tau = 0.61;%can be tuned
lambda = tau*kappa;
eta = (1-tau)*kappa;
mu = 30/norm(sign(D)); 
rho = 1.1; 
alpha = 1;
beta = .2;

Y = zeros(size(D));
E = zeros(size(D));
A = D;

tol_inner1 = 1e-4;
tol_inner2 = 1e-6;
tol_out = 1e-7;
err_out = 1;
MaxIter_out = 500;
MaxIter_inner1 = 1;
MaxIter_inner2 = 20;

iter_out = 0;
sv = 10;
tol_iter = 0;

while iter_out < MaxIter_out && err_out > tol_out
    iter_out = iter_out + 1; disp(iter_out);

    Ak = A; Ek = E;
    iter_inner1 = 0;
    err_inner1 = 1;

    while iter_inner1 < MaxIter_inner1 && err_inner1 > tol_inner1
        iter_inner1 = iter_inner1 + 1;

        G = D - Ek + Y/mu;
        Akk = G;
        Ahk = zeros(size(Akk));

        err_inner2 = 1;
        iter_inner2 = 0;

        while iter_inner2 < MaxIter_inner2 && err_inner2 > tol_inner2
            iter_inner2 = i
    
function can be downloaded here
% http://soi.stanford.edu/~rmunk/PROPACK/
function [A,E,tol_iter] = alm(D)

[n,p] = size(D);
kappa = 1.1;%can be tuned
tau = 0.61;%can be tuned
lambda = tau*kappa;
eta = (1-tau)*kappa;
mu = 30/norm(sign(D)); 
rho = 1.1; 
alpha = 1;
beta = .2;

Y = zeros(size(D));
E = zeros(size(D));
A = D;

tol_inner1 = 1e-4;
tol_inner2 = 1e-6;
tol_out = 1e-7;
err_out = 1;
MaxIter_out = 500;
MaxIter_inner1 = 1;
MaxIter_inner2 = 20;

iter_out = 0;
sv = 10;
tol_iter = 0;

while iter_out < MaxIter_out && err_out > tol_out
    iter_out = iter_out + 1; disp(iter_out);

    Ak = A; Ek = E;
    iter_inner1 = 0;
    err_inner1 = 1;

    while iter_inner1 < MaxIter_inner1 && err_inner1 > tol_inner1
        iter_inner1 = iter_inner1 + 1;

        G = D - Ek + Y/mu;
        Akk = G;
        Ahk = zeros(size(Akk));

        err_inner2 = 1;
        iter_inner2 = 0;

        while iter_inner2 < MaxIter_inner2 && err_inner2 > tol_inner2
            iter_inner2 = iter_inner2 + 1;
            
            %if choosvd(n, sv) == 1
            %    [U,Si,V] = lansvd(Akk, sv, 'L');
            %else
                %[U,Si,V] = svd(Akk, 'econ');
                [U,Si,V] = svdecon(Akk); % fastest
            %end