How to plot binary input ?

조회 수: 33 (최근 30일)
Nasser
Nasser 2011년 11월 24일
답변: salih 2015년 1월 2일
how to plot binary input using matlab?
for example; a = [ 1 0 0 0 1 1 0 1 0 1 0 1 0 1 ]

채택된 답변

Rick Rosson
Rick Rosson 2011년 11월 25일
Please try:
figure;
stairs([a,a(end)]);
HTH.
  댓글 수: 1
Nasser
Nasser 2011년 11월 25일
HTH : yeah, it does help .. thank you ;)

댓글을 달려면 로그인하십시오.

추가 답변 (5개)

Wayne King
Wayne King 2011년 11월 24일
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 2011년 11월 24일
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 2011년 11월 24일
I mean the plotting should looks like : http://www.olson-technology.com/mr_fiber/images/digital.gif
  댓글 수: 2
Walter Roberson
Walter Roberson 2011년 11월 24일
http://www.mathworks.com/help/techdoc/ref/stairs.html
Nasser
Nasser 2011년 11월 25일
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]

댓글을 달려면 로그인하십시오.


Rick Rosson
Rick Rosson 2011년 11월 24일
figure;
stairs(a);
  댓글 수: 1
Nasser
Nasser 2011년 11월 25일
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]

댓글을 달려면 로그인하십시오.


salih
salih 2015년 1월 2일
how polt binary even and odd from for example {0 0 1 1 0 0 }

카테고리

Help CenterFile Exchange에서 Transmitters and Receivers에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by