I would like to generate a random real symmetric square matrix with entries uniformly distributed between 0 and 1.
My attempt is:
a = rand(5);
b = a + a.'
My worry is that whilst matrix a is uniformly distributed according to the documentation http://www.mathworks.com.au/help/techdoc/ref/rand.html matrix b might not be since the average of two random numbers might not be the same as the original number.
I tried to use
hist(a);
hist(b)
but not sure how to interpret the resulting graph.
EDIT: According to Oli matrix b is no longer uniformly distributed, is there a way to make it that way?