查看单个帖子
旧 2019-12-10, 20:48   #1
poster
高级会员
 
注册日期: 2019-11-21
帖子: 3,006
声望力: 66
poster 正向着好的方向发展
帖子 如何在Matlab中显示我的100x1矢量数据的经验pdf?

我有一个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

更多&回答...
poster 当前离线   回复时引用此帖