generation of random numbers
조회 수: 1 (최근 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
댓글 수: 0
채택된 답변
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];
댓글 수: 2
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Random Number Generation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!