【发布时间】:2014-06-19 14:15:58
【问题描述】:
我已经写了这段代码:。
N=10000; % number of experiments
o= 1000+randn(1,N)*sqrt(10^4); % random normal distribution with mean 1000 and variance 10^4
b=700:50:1300; % specify the number of bins (possible values of the realizations)
prob=hist(o,b)/N %create ad histogram
X=[700:50:1300] **
现在,我如何创建一个包含 b 和 prob 值的矩阵? 换句话说,我想要一个这样的矩阵:
矩阵=[ X(i) 的值; X(i) 值处的概率关联]
es: 矩阵=[... X(i)=850... ; ...概率(X(i)=850)..]
非常感谢! ;)
【问题讨论】:
-
与任何单个值相关的概率为0。你应该重新考虑你想要什么
-
它不是 0。如果您运行脚本,您将获得概率。我唯一的问题是将它保存在矩阵中。
-
它 is 0。您的脚本给出了 intervals 的概率
-
我已经编辑了帖子。现在更清楚了?
-
恐怕不行。我坚持:value 的概率为 0。interval of values 的概率更有意义。看我的回答;这就是你想要的吗?
标签: matlab matrix histogram probability normal-distribution