generating random signal

조회 수: 37 (최근 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 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