Skip the calls to subplot? That would make your scrip "not put the graphs in 2 separate axes":
x1 = Pos1(t);
x2 = Pos2(t);
ph1 = plot(t, x1, '-', 'LineWidth', 2);
grid on;
hold on;
ph2 = plot(t, x2, '-', 'LineWidth', 2);
xlabel('t');
ylabel('x')
legend([ph1,ph2],'Mass1','Mass2')
drawnow;
Use a single call to plotyy? Use the double-axis capability available through yyaxis. Check the help and documentation to those functions.
HTH