t1 = linspace(0, 6, 500);
t2 = linspace(0, 11, 500);
t3 = linspace(0, 16, 500);
s1 = sin(25*pi*t1) .* exp(-0.5*t1);
s2 = sin(15*pi*t2) .* exp(-0.3*t2);
s3 = sin(10*pi*t3) .* exp(-0.2*t3);
xtv = [max(t1) max(t2) max(t3)];
figure(1)
plot(t1, s1)
hold on
plot(t2+xtv(1), s2)
plot(t3+xtv(1)+xtv(2), s3)
YL = ylim;
plot(cumsum([xtv(1:2); xtv(1:2)],2), YL(:)*[1 1], '--k', 'LineWidth',1)
hold off
set(gca, 'XLim',[0 sum(xtv)]);
xtix = [(0:xtv(1)-1) (0:xtv(2)-1) (0:xtv(3))];
set(gca, 'XTick',linspace(0, 1, numel(xtix))*(sum(xtv)), 'XTickLabel',xtix, 'FontSize',8)
Best Answer