function [metric] = match_metric(PssPs3_match, PssPs4_match, PssPs5_match, pow3, pow4, pow5)
%Checks how well simulated Pss/Ps matches observed Pss/Ps

medpow3 = median(pow3);
medpow4 = median(pow4);
medpow5 = median(pow5);

simpow3 = 10.*log10(PssPs3_match);
simpow4 = 10.*log10(PssPs4_match);
simpow5 = 10.*log10(PssPs5_match);

simpow_tot = cat(3,simpow3,simpow4,simpow5);

metric = sqrt( (simpow_tot(:,:,1) - medpow3).^2 + (simpow_tot(:,:,2) - medpow4).^2 + (simpow_tot(:,:,3) - medpow5).^2 );



end