How do I plot a bitstream of [1,0,1,0] on Matlab?
Show older comments
I dont want to plot random bits but thats all i seem to find on the net.
Accepted Answer
More Answers (2)
Oleg Komarov
on 12 Feb 2011
1 vote
Other two options:
%Create a a = randi([0,1],1,100)
First option
spy(a)
Second option
scatter(1:numel(a),a,'s','MarkerEdgeColor','w','MarkerFaceColor','k') set(gca,'YTick',[0 1],'ylim',[-0.5 1.5])

Oleg
1 Comment
mohammed AL-Mayali
on 3 Jul 2021
Thank you, sir... The first option is very useful
Henry
on 16 Jul 2015
bitstream = randi(2,50,1)-1; % create random stream of zeros and ones (binary)
stairs(bitstream); % This makes the bitstream visible
ylim([-5 5]); % Add some clearance above and below
Categories
Find more on Annotations in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!