From randn to bivariate Gaussian distribution image

131 Views Asked by At

In Matlab, I generated a bivariate Gaussian distribution with mean 50 and standard deviation 50:

G=50*randn((100*100)/2,2)+50;
histogram2(G(:,1),G(:,2));

The 3D histogram gives me the output I am looking for, but I rather want to create a 100x100 image (matrix of values) corresponding to the probabilities/frequencies of this histogram (like when looking at the histogram from above).

How would you proceed?

enter image description here

enter image description here

1

There are 1 best solutions below

0
On

Ok, I found that,

h=hist3(G,[100 100]);
imagesc(h)

actually does what I want, but any other methods are still welcome.

enter image description here

... But in fact not completely because regardless of the STD that i put the cloud of points on the image (imagesc) will look the same (rather than more or less spread out)