I have an array of three element: S=[4 3.9 3.8] and I want to randomly select one of those three numbers. The probability of selecting 4 is 0.5, the probability of selecting 3.9 is 0.4 and the probability of selecting 3.8 is 0.1.
Can anyone help me please?
1 Comment
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/506654-select-random-number-from-an-array-with-probabilities#comment_800051
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/506654-select-random-number-from-an-array-with-probabilities#comment_800051
Sign in to comment.