Hi Nathan,
Access the vector bits from 1 to 50 elements and pass as the first argument of stem function.
Then, pass the bits directly to scatterplot.
So, the above code will be as below:
close all; clear all;
M = 5;
k = log2(M);
N = 2e3;
sps = 4;
EbN0 = 10;
iBits = rand(N, 1) > 0.5;
bits = 2*iBits - 1;
figure;
stem(bits(1:50)); grid on;
title('Random bits'); xlabel('samples'); ylabel('amplitude');
scatterplot( bits ,1,0,'*r');grid on;
For more reference about usage of stem and scatterplot functions, go through these links:
Hope this helps.
Regards,
Sriram
Best Answer