generation of random numbers

1 visualizzazione (ultimi 30 giorni)
Offroad Jeep
Offroad Jeep il 1 Feb 2016
Commentato: Star Strider il 17 Mag 2016
Hi to all the Users, I have B = linspace(2,0,10); we have B = 2.0000 1.7778 1.5556 1.3333 1.1111 0.8889 0.6667 0.4444 0.2222 0 I want to generate random angle between 0 to 180 for each value of B in ascending order.first and last value should be 0 and 180
Thanking in anticipation

Risposta accettata

Star Strider
Star Strider il 2 Feb 2016
If I understand your Question correctly, this will do what you want:
B = [2.0000 1.7778 1.5556 1.3333 1.1111 0.8889 0.6667 0.4444 0.2222 0];
Angles = [0 sort(randi([1 179], 1, size(B,2)-2)) 180];

Più risposte (0)

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