How to make an input that can randomly produce +1 and -1 for every second?

Hello there,
Just want to know how could I make an input that produces +1 and -1 for every n seconds randomly. Any suggestions for Matlab or Simulink would be appreciated.
Many thanks,

Respuestas (3)

%For a 1x10 vector
sign(rand(1,10)-.5).*ones(1,10)
Paulo Silva
Paulo Silva el 14 de Feb. de 2011
Simulink
|random number (def. set.)|--|gain (10000)|--|saturation (-1 to 1)|-->output

La pregunta está cerrada.

Etiquetas

Preguntada:

el 14 de Feb. de 2011

Cerrada:

el 20 de Ag. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by