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 日

5 投票

please read about function rand
in your case:
out = 200*rand(2000,1);

その他の回答 (2 件)

Walter Roberson
Walter Roberson 2011 年 11 月 30 日

1 投票

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 日

0 投票

Nice

カテゴリ

ヘルプ センター および File ExchangeRandom Number Generation についてさらに検索

質問済み:

2011 年 11 月 30 日

回答済み:

2018 年 3 月 26 日

Community Treasure Hunt

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

Start Hunting!

Translated by