i cant understand this variable initialization

3 visualizaciones (últimos 30 días)
lyes
lyes el 30 de Dic. de 2013
Respondida: lyes el 30 de Dic. de 2013
hello everyone !! im new in matlab ... can anyone please explain me how a matrix X can contain values greater than 2 after the following initialization : X = [randn(100,2)+ones(100,2);... randn(100,2)-ones(100,2)];
i thought that rand() gives random values in the interval 0-1..and when adding ones() the values will be between 1 and 2.
M I missing something ?
thanks in advance.

Respuesta aceptada

Wayne King
Wayne King el 30 de Dic. de 2013
Editada: Wayne King el 30 de Dic. de 2013
You are using randn() not rand() -- those are very different things.
randn() gives N(0,1) random variables. Those usually take values from [-3,3]

Más respuestas (1)

lyes
lyes el 30 de Dic. de 2013
Thank you very much wayne for the answer

Categorías

Más información sobre Logical 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