Is there any function on Matlab/Octave that randomly picks a value from a list accordingly to a given probability?
For example: we have the vector [1 3 7]. The function I am looking for should pick one of those numbers with probability .25 for 1, .35 for 3 and .4 for 7.
I am trying to implement it myself, but I'd like to know if there is some build-in function for the next time I need something like this.