How to generate a random number that is either 100, 200, or 300.
조회 수: 4 (최근 30일)
이전 댓글 표시
Hello, I'm looking for a way to generate a random number that is either those 3 choices (nothing in between), utilizing only the rand, randi, round, floor, or ceil methods.
댓글 수: 0
채택된 답변
Image Analyst
2022년 10월 8일
As long as it's not your homework, you can use my code:
r = 100 * randi(3, 1)
댓글 수: 0
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!