poissrnd function issue: weird histogram
이전 댓글 표시
I tried to produce 10^6 poisson distributed random numbers and when i looked at the histogram, it had either some gaps or shoots depending upon the bin size... can anyone exlpain whats happening here?
t = zeros(1000000,1);
for i = 1:1000000
t(i,1) = poissrnd(100);
end
hist(t,300)

답변 (1개)
The loop is unnecessary:
histogram(poissrnd(100,1e6,1),300)
Works as expected.
댓글 수: 1
Saurabh Talele
2017년 9월 22일
편집: Saurabh Talele
2017년 9월 22일
카테고리
도움말 센터 및 File Exchange에서 Uniform Distribution (Continuous)에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!