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 日

2 投票

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 日

1 投票

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 日

0 投票

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 日

0 投票

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 日

0 投票

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 日

0 投票

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

タグ

質問済み:

2011 年 11 月 24 日

回答済み:

2015 年 1 月 2 日

Community Treasure Hunt

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

Start Hunting!

Translated by