I'm trying to read a Matlab script and can't figure out what does randn generate here:
a=0.1; b=a*randn;
Is it a random real number from (0, 1)?
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.
|
Documentation from Matlab R2012a
It will generate a number $x$ such that $x$ follows $N(0,1^2)$ My Box-Muller Implementation
|
|||||||||||||
|
|
From matlab:
|
|||
|
Googling "Matlab randn" gives, as a first result, this Matlab documentation. The first example there says:
In your case then you are generating numbers with a mean of 0 and a standard deviation of 0.1, as you have b = 0 + 0.1 * randn(100,1). In fairness, finding this through Google isn't hard. |
|||||||||||||||
|
randnstands forrandom normal. – FrenzY DT. Aug 13 '12 at 11:18mu+sigma*randn(rows,columns). – FrenzY DT. Aug 13 '12 at 11:35