Histogram graph help?
이전 댓글 표시
i have a vector called
r = zeros(1000, 1);
i use this vector to trap counts in some for and while loops... the for and while loops are working correctly and traping the values as expected.... i need the r vector wide to capture all the "potential" outcomes that "could" occur (because of probabilities) in the for and while loops.....this results in a large number of the r vector position having a zero value.
i want to plot a histogram graph of this vector r, but suppress all the zero locations. i just want to didplay the counts r vector in the histogram that are greater than zero..i cant figure out what attribute that is?
any suggestions?
댓글 수: 4
DGM
2021년 4월 25일
So, something like this?
histogram(r(r~=0),nbins);
James Baker
2021년 4월 25일
James Baker
2021년 4월 25일
James Baker
2021년 4월 25일
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Histograms에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!