%% obtain the common subspace

function neweigenvector=DRCA(Ms,Mt,batchS,batchT,lambda)
dim=size(batchS,1);

A=zeros(dim,dim);
A=A+pinv((Ms-Mt)*(Ms-Mt)')*(batchS*batchS'+lambda*batchT*batchT');
[eigenvector,eigenvalue]=eig(A);
[neweigenvalue,Idex] = sort(diag(eigenvalue),'descend');
neweigenvalue=diag(neweigenvalue);
neweigenvector=eigenvector(:,Idex);
end