In the Ex_CORAL.m I do not understand why you wrote the following script :
cov_source = cov(Xr) + eye(size(Xr, 2));
cov_target = cov(Xtt) + eye(size(Xtt, 2));
A_coral = cov_source^(-1/2)*cov_target^(1/2); %% Till here is OK
Sim_coral = Xr * A_coral * Xtt'
and also
Sim_Trn = trainset * M * trainset';
index = [1:1:size(Sim,1)]';
Sim = [[1:1:size(Sim,2)]' Sim'];
Sim_Trn = [index Sim_Trn ];
This is extraneous to what is mentioned in the paper "Return of Frustratingly Easy Domain Adaptation ".
Kindly have a look.