Generating random angles between interval
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
How would I generate three random angles between (-pi to pi)?
ex) q= [theta1 theta2 theta3], all theta are random numbers between -pi to pi
0 comentarios
Respuestas (1)
Star Strider
el 2 de Nov. de 2022
Try something like this —
random_angles3 = rand(1,3)*2*pi - pi
random_angles1000 = rand(1,1000)*2*pi - pi;
figure
histogram(random_angles1000, 25)
.
0 comentarios
Ver también
Categorías
Más información sobre Random Number Generation en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!