Azzera filtri
Azzera filtri

how to generate a random number between the range -50 to 50?

4 visualizzazioni (ultimi 30 giorni)
a=rand(1,[-50,50])

Risposte (1)

Andrei Bobrov
Andrei Bobrov il 28 Lug 2017
Modificato: Andrei Bobrov il 28 Lug 2017
a = 10*(rand()-.5)
or integer namber
a = randi([-50,50])

Categorie

Scopri di più su Random Number Generation in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by