Plot Data into a Histogramm

조회 수: 1 (최근 30일)
Mark S
Mark S 2020년 4월 2일
댓글: Mark S 2020년 4월 2일
Hello,
i have written this script:
a = exprnd(200, 100, 1);
small = find( a < 57 );
a ( small ) = 57;
classification = zeros( 100,1 );
edges = [57 66.51 84.51 111.51 145.01 180.01 224.91 1000]
for k = 1:length(a)
for m = 1:length(edges)
if a(k) >= edges(m) && a(k) < edges(m+1)
classification(k) = m;
end
end
end
C = categorical(classification,[1 2 3 4 5 6 7],{'WG1','WG2','WG3','WG4','WG5','WG6','WG7'})
h = histogram(C,'BarWidth',0.9)
And i have plottet my data into a Histogram.
My question: Is my histogram ok?
Because i thought that in a histogram the most frequent data must be in the middle? And not on the right side...

답변 (1개)

KALYAN ACHARJYA
KALYAN ACHARJYA 2020년 4월 2일
"My question: Is my histogram ok?"
Ans: OK, as per your data
"Because i thought that in a histogram the most frequent data must be in the middle? And not on the right side..."
No, the shape of the histogram plot purely depends on the what type of data value. Its just the plot the bins along with occurance of number (events)

카테고리

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