f = 60; % Hz tmin = -0.05; tmax = 0.05; t = linspace(tmin, tmax, 400); x_c = cos(2*pi*f * t); plot(t,x_c) xlabel('t (seconds)')
T = 1/800; nmin = ceil(tmin / T); nmax = floor(tmax / T); n = nmin:nmax; x1 = cos(2*pi*f * n*T); hold on plot(n*T,x1,'.') hold off
T = 1/400; nmin = ceil(tmin / T); nmax = floor(tmax / T); n = nmin:nmax; x1 = cos(2*pi*f * n*T); plot(t, x_c) hold on plot(n*T, x1, '.') hold off
T = 1/120; nmin = ceil(tmin / T); nmax = floor(tmax / T); n = nmin:nmax; x1 = cos(2*pi*f * n*T); plot(t, x_c) hold on plot(n*T, x1, 'o') hold off
T = 1/70; nmin = ceil(tmin / T); nmax = floor(tmax / T); n = nmin:nmax; x1 = cos(2*pi*f * n*T); plot(t, x_c) hold on plot(n*T, x1, 'o') hold off
T = 1/70; x_c = cos(2*pi*10 * t); nmin = ceil(tmin / T); nmax = floor(tmax / T); n = nmin:nmax; x1 = cos(2*pi*f * n*T); plot(t, x_c) hold on plot(n*T, x1, 'o') hold off