r = randi([0 1], 1, 100);%a randi functin to generate a sequence of 100 random bits (0 or 1)
s = rectpulse(r,100);%rectangular pulse, where r is the row vector representing the random bits
time = [10^-9:10^9:10^-6];
figure(6);%plots graph 6
plot(time, s);%plots time against s
title('the waveform vs time - 2021198');
