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: dual_rpca_2.m
    path of file: ./repos/lrslibrary/algorithms/rpca/DUAL
    
    the code of the file until where you have to start completion: function [A_dual, E_dual, Y, iter] = dual_rpca_2(D, lambda, tol, maxIter, LineSearchFlag, outputFile)

% This matlab code implements the dual method for RPCA.
%

    
function [A_dual, E_dual, Y, iter] = dual_rpca_2(D, lambda, tol, maxIter, LineSearchFlag, outputFile)

% This matlab code implements the dual method for RPCA.
%
% The Primal Robust PCA relaxation
% min \tau ( |A|_* + \lambda |E|_1 ) + 1/2 |(A,E)|_F^2
% subj  A+E = D
%
% The Dual problem
% max trace(D' * Y)
% subj max( |Y|_2, 1 \ \lambda |Y|_inf) <= 1
%
% References
% "Robust PCA: Exact Recovery of Corrupted Low-Rank Matrices via Convex Optimization", J. Wright et al., preprint 2009.
% "Fast Convex Optimization Algorithms for Exact Recovery of a Corrupted Low-Rank Matrix", Z. Lin et al.,  preprint 2009.
%
% Minming Chen, June 2009. Questions? v-minmch@microsoft.com ; 
% Arvind Ganesh (abalasu2@illinois.edu)
%
% Copyright: Perception and Decision Laboratory, University of Illinois, Urbana-Champaign
%            Microsoft Research Asia, Beijing

[m,n] = size(D);

if(nargin < 2) lambda = 1 / sqrt(m); end