Randomize set of numbers but don't want more than 2 repeats in a row

I am trying to randomize a set of 3 numbers (1,2,3), each repeated 40 times. So im looking to make a 120x1 matrix, with the numbers 1,2,3 randomized and repeated 40times each. However, I want to pseudorandomize them so that alike numbers are not next to each other more than twice. Is there a way to do this?

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!