I need to draw random numbers following a distribution I chose.
Example: draw 7 numbers from 1 to 7 with those probabilities:
- 1: 0.3
- 2: 0.2
- 3: 0.15
- 4: 0.15
- 5: 0.1
- 6: 0.05
- 7: 0.05
Since in my actual application I need to draw potentially 1000 numbers I need this to be as much efficient as possible (ideally linear). I know there is a function in MATLAB that draws random numbers from a normal distribution; is there any way to adapt it?