How to plot binary input ?

how to plot binary input using matlab?
for example; a = [ 1 0 0 0 1 1 0 1 0 1 0 1 0 1 ]

 Respuesta aceptada

Rick Rosson
Rick Rosson el 25 de Nov. de 2011

2 votos

Please try:
figure;
stairs([a,a(end)]);
HTH.

1 comentario

Nasser
Nasser el 25 de Nov. de 2011
HTH : yeah, it does help .. thank you ;)

Iniciar sesión para comentar.

Más respuestas (5)

Wayne King
Wayne King el 24 de Nov. de 2011

1 voto

a = [ 1 0 0 0 1 1 0 1 0 1 0 1 0 1 ];
stem(a,'markerfacecolor',[0 0 1]);
set(gca,'ylim',[-1.5 1.5])
Jan
Jan el 24 de Nov. de 2011

0 votos

a = [ 1 0 0 0 1 1 0 1 0 1 0 1 0 1 ];
plot(a);
or perhaps:
plot(1:length(a), a, 'o');
Nasser
Nasser el 24 de Nov. de 2011

0 votos

I mean the plotting should looks like : http://www.olson-technology.com/mr_fiber/images/digital.gif

2 comentarios

Walter Roberson
Walter Roberson el 24 de Nov. de 2011
http://www.mathworks.com/help/techdoc/ref/stairs.html
Nasser
Nasser el 25 de Nov. de 2011
that is what I was looking for.
but there is a problem, the last binary input always missing !!
I mean when the input is a = [ 1 0 1 ]
it only draw [1 0]

Iniciar sesión para comentar.

Rick Rosson
Rick Rosson el 24 de Nov. de 2011

0 votos

figure;
stairs(a);

1 comentario

Nasser
Nasser el 25 de Nov. de 2011
that is what I was looking for.
but there is a problem, the last binary input always missing !!
I mean when the input is a = [ 1 0 1 ]
it only draw [1 0]

Iniciar sesión para comentar.

salih
salih el 2 de En. de 2015

0 votos

how polt binary even and odd from for example {0 0 1 1 0 0 }

Etiquetas

Preguntada:

el 24 de Nov. de 2011

Respondida:

el 2 de En. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by