Possible Duplicate:
Generate random number with given probability matlab
I need to create a column vector with random assignments of the number 1, 2 and 3. However i need to be able to control the percentage occurrence of each oif these 3 numbers.
For example, i have a 100 x 1
column vector and I want 30 of the number 1, 50 of the number 2 and 20 of the number 3, in a random assignments.