generating random signal

40 vues (au cours des 30 derniers jours)
Daniel
Daniel le 30 Nov 2011
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 :)

Réponse acceptée

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

Plus de réponses (2)

Walter Roberson
Walter Roberson le 30 Nov 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 le 26 Mar 2018
Nice

Catégories

En savoir plus sur Random Number Generation dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by