How do I create a random matrix from a normal distribution given the mean and variance (mean = 2 and variance = 8).

17 visualizaciones (últimos 30 días)
From a 100x100 random matrix that I have previously created I need to create another random matrix from a normal distribution given the mean and variance (let's say that mean is 2 and variance is 8). Does anyone know how to do this?
  5 comentarios
Tai Lopez
Tai Lopez el 14 de Oct. de 2018
Amazing! I'm glad that you're happy now. Is that where you filmed your Despacito?
Star Strider
Star Strider el 14 de Oct. de 2018
@Tai, @Luis —
I do not have any MATLAB garages. What am I doing wrong?

Iniciar sesión para comentar.

Respuesta aceptada

Star Strider
Star Strider el 13 de Oct. de 2018
I would just do this:
mu = 2;
vr = 8;
RandomNormalMatrix = mu + sqrt(vr)*randn(100);
See the documentation on the randn (link) function for details.
  3 comentarios
Tan Nguyen
Tan Nguyen el 8 de Abr. de 2021
Could you tell me how the result changes if we use randn(1000000) in spite of randn(100)?
Thank you,

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Random Number Generation en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by