randn command variance problem
Mostrar comentarios más antiguos
Hello, i am trying to create a randomly distributed temperature where the avarage is 310 and variance is 4.
I wrote the following code, but as could be seen from the plot bellow it gives me values of 318 ,301 which are far away from variance 4.
Where did i go wrong?
Thanks
n=100000;
Temp_rand=2*randn(n,1);
T = 37+273+Temp_rand;
plot(T);
xlabel('sample number');
ylabel('Temperature');

Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Random Number Generation en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
