Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.
|
|
sudesh
Posts:
15
Registered:
11/2/11
|
|
Re: pseudo random image with values -1 and 1 , zero mean and Gaussian distribution
Posted:
May 7, 2012 5:57 AM
|
|
"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <jo84si$acc$1@newscl01ah.mathworks.com>... > > > > but I need only two values -1 and 1 randomly in matrix. > > > > like this one - [-1 1 -1 1 1 1 -1; > > 1 -1 1 1 1 -1 1] > > > > no zeros or other value. Along with property of zero mean of whole matrix. > > So what is the connection with "Gaussian distribution" ? Don't use the vocabulary that you wasn't sure the meaning. > > To generate {-1 +1}, equally distributed simply use RAND() > > 2*(rand(2,7) > 0.5) - 1 > > Bruno
ahh, you saved me.... Thanks a lot! but still the resulting matrix does not have zero mean. I tried this-
>> a=2*(rand(2,7) > 0.5) - 1; >> mean(a(:))
ans =
-0.5714
>>
Also, about the gaussian distribution, Ijust quoted the research paper's statement.
|
|
|
|