How to fill larger array with the values of another array randomized?
Show older comments
Hello,
E.g. I got an 'X' array with [1 2 3 4] and want to fill an 'Y' array which is length 8. The restrictions are:
- All values of 'X' array must be in the 'Y' array at least once.
- The values of 'X' are picked random and put in the 'Y' array.
An example of array 'Y' = [1 4 3 1 4 2 1 1].
Is there any function in Matlab which can accomplish this?
Thanks for the help!
Accepted Answer
More Answers (0)
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!