Reputation: 2131
Let's say R is a mxn random matrix. How can generate R with each entry of R is independent and identically chosen from any distribution with mean zero and variance mu^2?
Upvotes: 0
Views: 441
Reputation: 172
You probably want 'randn', which chooses entries from a Gaussian distribution with norm 1. To get a variance of mu^2, use
mu*randn(m,n)
For instance:
x=10*randn(1,1e5);var(x)
I get:
ans =
99.8547
Mileage may vary. =)
Upvotes: 1