Borrar filtros
Borrar filtros

How create a random sequence

7 visualizaciones (últimos 30 días)
pizarro
pizarro el 24 de Nov. de 2013
Comentada: pizarro el 24 de Nov. de 2013
Hi, I want to create a random sequence of 10 elements with values +- 2.How can i do it?
BR,
José Manuel.
  1 comentario
the cyclist
the cyclist el 24 de Nov. de 2013
Do you want only values of -2 and 2, or continuous values uniformly in between, like -1.732 and 0.365?

Iniciar sesión para comentar.

Respuesta aceptada

the cyclist
the cyclist el 24 de Nov. de 2013
Editada: the cyclist el 24 de Nov. de 2013
Just -2 and 2:
R = 4*round(rand(1,10)) - 2;
Continuous:
R = 4*rand(1,10) - 2;
  1 comentario
pizarro
pizarro el 24 de Nov. de 2013
Thank you very much, I´m starting to study Matlab from myself.
BR,
José Manuel.

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by