I need to generate a number randomly which is either -1 or 1
15 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
MK96
am 22 Okt. 2016
Kommentiert: MK96
am 22 Okt. 2016
Trying to generate either -1 or 1 randomly.
I have looked at;
R = unifrnd(-1,1)
however this generates a random number in the interval (-1,1) whereas I am trying to generate a random number which is either -1 or 1
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Random Number Generation 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!