X=rand(10,1)*(9-1)+1 How should I change this code to make at least one number >2.
MATLAB: How to generate a random vector between 1-9 with 10 numbers and at least one number should be >2.
Related Question
- Random numbers
- How to generate a matrix of random integers from 55 to 100
- Non-repeating random integer generator with a seed
- I’m supposed make a vector called Vec that contains a 1×9 ranging from integers 1 through 9 in random order. There always tends to be a zero in the vector when the code is ran. How to find the zeros and replace them with an integer from 1-9.
- Random numbers
- Generating random integer from -x to x
Best Answer