How can I generate random number between 1 and 10, and at the same time I want to exclude number 3 & 6?

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

What have you tried so far? What specific problems are you having with your code?
I want to have one single number from the randomization process (Between 1 & 10). But the number must not be 3 & 6. So it can be either 1,2,4,5,7,8,9 or 10.
Why not generate a number between 1 and 10 and if it's 3 or 6 retry? Seems simple enough.

Sign in to comment.

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!