how to plot probability density plot ?
5 次查看(过去 30 天)
显示 更早的评论
I have two dimensional array 1*120, I want to make probability density plot in. how to I plot in matlab?
0 个评论
回答(1 个)
Image Analyst
2015-2-28
How about calling hist() and bar() or plot()?
data = randn(1, 120)
[counts, binCenters] = hist(data, 16)
counts = counts / sum(counts); % Normalize
bar(binCenters, counts)
grid on;
2 个评论
Image Analyst
2017-8-19
You're welcome. You can vote for answers if you want to "thank" the poster with reputation points. Now, with recent releases of MATLAB, we use histcounts() or histogram() instead of hist().
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Histograms 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!