n = [0:5].'; t = [0:0.01:5].';
X = cos(2*pi*n*[0.1 1.1 2.1]);
Y = cos(2*pi*t*[0.1 1.1 2.1]);
plot(t,Y); hold on; stem(n,X); hold off;
xlabel('Time $t$ and Index $n$','Interpreter','latex','FontSize',16)
ylabel('Amplitude','Interpreter','latex','FontSize',16);