Filter löschen
Filter löschen

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

5 Ansichten (letzte 30 Tage)
aya
aya am 5 Nov. 2013
Beantwortet: Azzi Abdelmalek am 5 Nov. 2013
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

Akzeptierte Antwort

Azzi Abdelmalek
Azzi Abdelmalek am 5 Nov. 2013
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

Weitere Antworten (0)

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by