MATLAB: White zero mean gaussian random process with different variance

gaussian random processrandom number generator

Hi,
i want to generate White zero mean gaussian random process with different variance.
i am generating using below code, is that right??
C0 = normrnd(0,sigmatau0);
for n=1:10
C_s(n) = normrnd(0,sigmataun_s(n));
C_b(n) = normrnd(0,sigmataun_b(n));
end
sigmatau0,sigmatau_s and sigmatau_b is already define
thank you

Best Answer

Yes, normrnd() is the function you want to use. The second input specifies the sandard deviation. You are generating one sample at each standard deviation -- is that really what you want to do?
Don't forget to allocate your loop variables.
C_s = zeros(1,10);
C_b = C_s;
for n = 1:10
...
end