Borrar filtros
Borrar filtros

How to make operator for random matrix(matlab command is randn) ? please help me

1 visualización (últimos 30 días)
How to make operator for random matrix(matlab command is randn) ? please help me

Respuesta aceptada

Star Strider
Star Strider el 4 de Mayo de 2014
Editada: Star Strider el 4 de Mayo de 2014
If you want to create normally-distributed random variables with a standard deviation of s and a mean of m with randn, this will work:
nrmrnd = @(m,s) m + s*randn;
or if you want a row r by column c matrix of them:
nrmrnd = @(m,s,r,c) m + s*randn(r,c);
  4 comentarios
SUMIT
SUMIT el 4 de Mayo de 2014
sir,this is not an operator. In your first comment you give the operator.I need that type of operator. Please help....
Star Strider
Star Strider el 4 de Mayo de 2014
This function should work:
xrndn = @(x) randn(length(x))*x(:);
Call it as:
y = xrndn(x);
for any vector x.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by