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개)

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 CenterFile Exchange에서 Histograms에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by