round, randn

4 visualizaciones (últimos 30 días)
PChoppala
PChoppala el 19 de Feb. de 2012
Editada: Image Analyst el 16 de Oct. de 2013
Hello
Simple query.
Suppose I assign y=randn(4,1), I get a 4X1 matrix with random numbers which have (may be) 3-4 number after the decimal point.
Can you please help, what I should write to get the one number after the decimal point.
y=some round or fix op((randn(4,1)))
Cheers
  1 comentario
Jan
Jan el 19 de Feb. de 2012
Is this a homework question?
Btw. RANDN replies 15 digits.

Iniciar sesión para comentar.

Respuestas (1)

Jan
Jan el 19 de Feb. de 2012
At first remove the integer part, see round or rem. Then multiply the result by 10. The remaining steps are not complicated.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by