How to create a histogram for given data ??

9 ビュー (過去 30 日間)
EMRE
EMRE 2013 年 9 月 29 日
コメント済み: Image Analyst 2013 年 9 月 29 日
Hi all! Let's say I have 2 set of numbers;
A = 3, 5, 7, 9
B = 2000, 2010, 2020, 2030
My question is how can I create a histogram such that A would be on the x-axis and B would be on the y-axis. Thanks.
  3 件のコメント
EMRE
EMRE 2013 年 9 月 29 日
Can I do the same thing by using hist() function ? If yes how ? :)
Image Analyst
Image Analyst 2013 年 9 月 29 日
What do you want to take the histogram of? We were assuming that A was already the histogram - the counts - and that B was the bin centers.

サインインしてコメントする。

回答 (1 件)

Wayne King
Wayne King 2013 年 9 月 29 日
As dpb has told you, use bar()
A = [3 5 7 9];
B = [2000 2010 2020 2030];
bar(A,B,'barwidth',0.4)
set(gca,'ylim',[1990 2050])
  1 件のコメント
EMRE
EMRE 2013 年 9 月 29 日
Can I do the same thing by using hist() function ? If yes how ? :)

サインインしてコメントする。

カテゴリ

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