generating random signal

38 ビュー (過去 30 日間)
Daniel
Daniel 2011 年 11 月 30 日
回答済み: Usman Kabir 2018 年 3 月 26 日
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 Center および File ExchangeRandom Number Generation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by