generation of random numbers

1 visualización (últimos 30 días)
Offroad Jeep
Offroad Jeep el 1 de Feb. de 2016
Comentada: Star Strider el 17 de Mayo de 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

Respuesta aceptada

Star Strider
Star Strider el 2 de Feb. de 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];
  2 comentarios
Star Strider
Star Strider el 17 de Mayo de 2016
That link doesn’t point to a specific Question.

Iniciar sesión para comentar.

Más respuestas (0)

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!

Translated by