フィルターのクリア

how can I draw histogram of a sine wave without "hist" command and with "plot" command?

3 ビュー (過去 30 日間)
mah esi
mah esi 2013 年 3 月 9 日
I want to write a program to draw a histogram for sine wave without the "hist" command and draw its histogram with "plot" command. the number of Bins can be a constant number. or evenif I can define a function that its input are : the number of Bins and the signal varible. I don't know how , can any body help me?

回答 (1 件)

Walter Roberson
Walter Roberson 2013 年 3 月 9 日
It can be done. You would need to use something like
plot( [1 1 2 2 3 3 4 4 5 5], [0 v1 v1 0 0 v2 v2 0 0 v3])
where v1, v2, v3 are the height values.
Have you considered using bar() instead of plot()

カテゴリ

Help Center および File ExchangeHistograms についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by