【发布时间】:2015-05-28 12:43:16
【问题描述】:
我已经有了这段代码,我从高斯分布中借用了一些代码并对其进行了修改。 如下
[f,x]=hist(rand(1000000,1),50);%# create histogram from a normal distribution.
g=1/sqrt(2*pi)*exp(-0.5*x.^2);%# pdf of the normal distribution
%#METHOD 2: DIVIDE BY AREA
figure(2)
bar(x,f/trapz(x,f));hold on
plot(x,1,'r');hold off .
现在有什么我可以改变它以使红线不分色或不分色吗? 让我知道 。 非常感谢!!
【问题讨论】:
标签: matlab distribution uniform