How do I plot a bitstream of [1,0,1,0] on Matlab?

Más respuestas (2)

Oleg Komarov
Oleg Komarov el 12 de Feb. de 2011

1 voto

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

Henry
Henry el 16 de Jul. de 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

Categorías

Productos

Preguntada:

el 12 de Feb. de 2011

Comentada:

el 3 de Jul. de 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by