フィルターのクリア

Too many plots..too little time!!

1 回表示 (過去 30 日間)
Kash022
Kash022 2018 年 2 月 12 日
回答済み: Image Analyst 2018 年 2 月 12 日
Could anyone please explain the difference between/ when to use hist,histc, histfit,bar,barh, normplot? Suppose I have a n x 1 data points and would like to plot a normal (gaussian) distribution. What would be my best choice?
Thanks (and sorry if the question sounds stupid)

採用された回答

Image Analyst
Image Analyst 2018 年 2 月 12 日
Well you can read the documentation as well as we can, but here's a very, very short version of what you'll find there. If you want to plot a histogram of your data (which may or may not be Gaussian) plotted, use histogram(). If you don't want a plot, use histcounts(). If you want the histogram plotted plus the Gaussian over it, use histfit(). If you want just the Gaussian plotted, use fitdist(). bar() and barh() can be used if you want to plot on your own, manually, with the arrays you get returned from histcounts() or histogram(). If you want some idea of how much your data matches a perfect Gaussian, use normplot().

その他の回答 (1 件)

Jos (10584)
Jos (10584) 2018 年 2 月 12 日
編集済み: Jos (10584) 2018 年 2 月 12 日
why don't you try histogram and use the help to improve the plot, add a fit etc.
n = 10+5*randn(1,100) ;
histogram(n)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by