MATLAB: What does the notation ( ‘ ) in the time sample t = (0:dt:0.002-dt) ‘ mean ??and thanks in advance

spectrum of cos signal

Fs = 800e3;
dt = 1/Fs;
t = (0:dt:0.002-dt)';
Fm = 5000;
y = cos(2*pi*Fm*t);
figure;
plot(t,y);

Best Answer

It is just making a column vector out of your time instants so that the resulting sine wave is also a column vector.
The above example would work equally well without the ', the only difference being that t and y would be row vectors
Fs = 800e3;
dt = 1/Fs;
t = (0:dt:0.002-dt);
Fm = 5000;
y = cos(2*pi*Fm*t);
figure;
plot(t,y);
However, further processing might be made easier by having a column vector.
Related Question