Change histogram to more bars

9 ビュー (過去 30 日間)
Mustafa Vural
Mustafa Vural 2020 年 10 月 25 日
コメント済み: Mustafa Vural 2020 年 10 月 25 日
I am generating random numbers. The histogram has a sample size of 20 but only 5 bars. How can I control the bar numbers?

採用された回答

Sindar
Sindar 2020 年 10 月 25 日
histogram accepts the number of bins as a second argument:
x = randn(1000,1);
nbins = 25;
h = histogram(x,nbins)
  1 件のコメント
Mustafa Vural
Mustafa Vural 2020 年 10 月 25 日
thank you very much!

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

その他の回答 (1 件)

drummer
drummer 2020 年 10 月 25 日
This doc for histogram has the info to play with the number of bins in your histogram
If you're using such command, you can do it by histogram(X, nBinsYouWant)
  1 件のコメント
Mustafa Vural
Mustafa Vural 2020 年 10 月 25 日
thank you for the advice!

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

カテゴリ

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