generating random signal

38 次查看(过去 30 天)
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 :)

采纳的回答

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

更多回答(2 个)

Walter Roberson
Walter Roberson 2011-11-30
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 2018-3-26
Nice

类别

Help CenterFile Exchange 中查找有关 Random Number Generation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by