t = linspace(0,1,1000);
t1 = 0:0.01:1;
t2 = 0:0.11:1;
t3 = 0:0.21:1;
xc = @(t) sin(20*pi*t)+cos(40*pi*t);
x = xc(t);
x1 = xc(t1);
x2 = xc(t2);
x3 = xc(t3);
plot(t,x)
hold on
stem(t1,x1,'r')
hold on
stem(t2,x2,'g')
hold on
stem(t3,x3,'k')
hold off
