How can I generate random number between 1 and 10, and at the same time I want to exclude number 3 & 6?
Show older comments
How can I generate random number between 1 and 10, and at the same time I want to exclude number 3 & 6 using M-file?
3 Comments
James Tursa
on 21 Mar 2019
What have you tried so far? What specific problems are you having with your code?
Mohd Helmi Mansor
on 21 Mar 2019
Guillaume
on 21 Mar 2019
Why not generate a number between 1 and 10 and if it's 3 or 6 retry? Seems simple enough.
Accepted Answer
More Answers (0)
Categories
Find more on Random Number Generation in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!