フィルターのクリア

si=2*(roun​d(rand(1,s​bit))-1/2)​;

5 ビュー (過去 30 日間)
aya
aya 2013 年 11 月 5 日
回答済み: Azzi Abdelmalek 2013 年 11 月 5 日
i am trying to generate a random signal with only +1 & -1 the code works the only problem that i donot under stand way we put the 2 and -1/2

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 11 月 5 日
a=rand%
b=rand(a) % the result is 0 or 1
%If b=1
2*(1-1/2)=1
%If b=0
2*(0-1/2)=-1

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by