我有一个100x1向量的数据。如何在Matlab中显示其经验pdf?另外,如果我想在同一张图上比较三个向量的pdf,那么该怎么做?
现在,我正在使用
pdfplot.m文件来绘制我的经验pdf,但是,当我想使用“保持”来比较3个分布时,首先它不起作用,其次所有颜色都使用相同的颜色。谢谢!
编辑:我不想绘制CDF。
回答:
历史 :
hist(data) 或者,如果您想更好地控制其呈现方式,请使用:
[n,x] = hist(data); plot(x,n,'rx-'); %# just an example, plot the pdf with red x's and a line, %# instead of bars figure; plot(x, cumsum(n)/sum(n)); %# plot the CDF
更多&回答...