MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   [求助]怎样画数组中各个数的出现概率的直方图 (https://www.labfans.com/bbs/showthread.php?t=6912)

songzhouran 2009-03-18 12:37

[求助]怎样画数组中各个数的出现概率的直方图
 
好像hist只能画出现的次数,那换成出现概率怎么办呢?:confused:

slgu 2009-03-18 16:36

回复: [求助]怎样画数组中各个数的出现概率的直方图
 
如:
x=randn(50);
[f,h]=hist(x(:))
bar(h,f,1)
or
f=f/2500;
bar(h,f,1)

xiezhh 2009-03-18 19:00

回复: [求助]怎样画数组中各个数的出现概率的直方图
 
data=normrnd(0,1,1000,1);
[fp,xp]=ecdf(data);
ecdfhist(fp,xp);


所有时间均为北京时间。现在的时间是 11:04

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.