Plot Data into a Histogramm
显示 更早的评论
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
2020-4-2
0 个投票
"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)
类别
在 帮助中心 和 File Exchange 中查找有关 Histograms 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!