function new_map=contract_mappings(mapping_1,mapping_2) % Constructs a new mapping by combining two earlier mappings. Use of this % function in series may help combine any number of mappings. % %mapping_1 - (number of particles)x2 column matrix % %For bugs, comments, etc. please contact Kapil Krishan : %kkrishan@uci.edu %www.physics.uci.edu/~foams %version: I [C,IA,IB]=intersect(mapping_1(:,2),mapping_2(:,1)); new_map=[mapping_1(IA,1) mapping_2(IB,2)];