generation of random numbers

2 次查看(过去 30 天)
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

采纳的回答

Star Strider
Star Strider 2016-2-2
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];

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Random Number Generation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by