high_loc_ID_factors = {'ID1', 10; 'ID2', 20; 'ID3', 30};
high_empathy_ID_factors = {'ID2', 5; 'ID1', 15; 'ID3', 25};
high_itc_sopi_ID_factors = {'ID3', 8; 'ID1', 18; 'ID2', 28};
ids1 = high_loc_ID_factors(:, 1);
ids2 = high_empathy_ID_factors(:, 1);
ids3 = high_itc_sopi_ID_factors(:, 1);
common_ids = intersect(intersect(ids1, ids2), ids3);
aligned_loc = cell(length(common_ids), size(high_loc_ID_factors, 2));
aligned_empathy = cell(length(common_ids), size(high_empathy_ID_factors, 2));
aligned_itc_sopi = cell(length(common_ids), size(high_itc_sopi_ID_factors, 2));
for i = 1:length(common_ids)
aligned_loc(i, :) = high_loc_ID_factors(strcmp(ids1, id), :);
aligned_empathy(i, :) = high_empathy_ID_factors(strcmp(ids2, id), :);
aligned_itc_sopi(i, :) = high_itc_sopi_ID_factors(strcmp(ids3, id), :);
high_concatenated = horzcat(aligned_loc, aligned_empathy(:, 2:end), aligned_itc_sopi(:, 2:end));