How do you generate random numbers (integers) from zero to five ?

Hello , I have already read from the HELP section in matlab and I am still unable to find a solution. Can someone please help !
Generate random integers that are Non -repeating

 Accepted Answer

This will generate a vector of non-repeating random integers from 0 to 5:
R = randperm(6)-1
producing (in this instance):
R =
5 2 3 1 0 4

2 Comments

Thank you very much Star Strider !!
My pleasure!
If my Answer solved your problem, please Accept it.

Sign in to comment.

More Answers (0)

Categories

Find more on Random Number Generation in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!