From randn to bivariate Gaussian distribution image

$\begingroup$

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

$\endgroup$

1 Answer

$\begingroup$

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)

$\endgroup$

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like