generating random signal

39 visualizaciones (últimos 30 días)
Daniel
Daniel el 30 de Nov. de 2011
Respondida: Usman Kabir el 26 de Mzo. de 2018
how do i write a simple matlab code that generates a random signal with amplitude varying from 0 to 200 and has length of 2000??
thanks in advance :)

Respuesta aceptada

Andrei Bobrov
Andrei Bobrov el 30 de Nov. de 2011
please read about function rand
in your case:
out = 200*rand(2000,1);

Más respuestas (2)

Walter Roberson
Walter Roberson el 30 de Nov. de 2011
rand() returns numbers in the range 0 to 1. You can scale and translate those number as needed. You can tell rand() how many values you want to generate.

Usman Kabir
Usman Kabir el 26 de Mzo. de 2018
Nice

Categorías

Más información sobre Random Number Generation en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by