How does the signal look when we don't use the Nyquist rate to remove aliasing from a signal during sampling?

Let's suppose the signal is sinusoidal, with a frequency of 500&nbsp;Hz and an amplitude of 2.

signal = 2*cos(2*pi*500*t)


If I sample it, (replacing t=nTs , Ts = sampling period and n represent number of samples) and plotting the sampled signals with a different sampling period using the subplot command in MATLAB, how could I identify the aliasing in a sampled signal?

Here is the example code that plotted two signals, one at the Nyquist rate while the other less than the Nyquist rate:

A = 2;
Fmax = 10;
Fs = 2*Fmax;
n = 0:1/Fs:1;
Cont = A*sin(2*pi*(Fmax/Fs)*n);
Cont1 = A*sin(2*pi*(Fmax/18)*n);
subplot(2,1,1)
stem(n,Cont)
hold on
stem(n,Cont1)


and here is the waveform:



I wasn't able to identify the aliasing. How did it affect the signal when Nyquist rate didn't use?


Question: Why was this grammar & formatting edit rejected?
Answer: Most likely because of the unneeded inline code blocks. Those do not always make things easier to read. When used excessively for things that are easily identifiable as code, such as UITableView, they actually make the post harder to read. Reserve its use for segments of code that belong together or for keywords that would otherwise not make sense in the context of the post without being identified as inline code.

I, personally, would have skipped this one because I don't have any strong feelings one way or the other. Just a note: changing "I am" to "I'm" is really not edit-worthy. I don't know why you even made that change.