Help with array selection

I'm trying to make a selection process using roulette wheel selection. To do this I created two matrix, one random probabilities and one increasing probabilities. The idea is to choose a number according to the random probabilities. Here is the code I've written.