I think you still do not appreciate that you cannot just say something is "random" and not define the distribution.
For example, if we generate a sequence of 100 numbers that are EXACTLY either 0.1 OR 3.5, but the probability of 3.5 happens 10% of the time, then it satisfies your requirement. That is trivial to do.
X = (rand(1,100) > 0.9)*3.4 + 0.1;
So here we have a random sequence where 11% of the 100 numbers exceeded 2. Since the sequence is of length 100, that means we had 11 of the 3.5 events, and 89 of the 0.1 events. As the sequence length goes to infinity, the probability of exceeding 2 will approach 10% quite nicely.
Here are the first 20 events in that sequence:
Columns 1 through 9
0.1 0.1 0.1 3.5 0.1 0.1 0.1 3.5 0.1
Columns 10 through 18
0.1 0.1 3.5 0.1 0.1 0.1 0.1 0.1 0.1
Columns 19 through 20
It completely satisfies your requirements, but I may postulate, based on your example, that it does not satisfy your goals.
So, do you want some sort of uniform distribution in each sub-interval? That is, it is easy enough to generate a misture distribution, where 10% of the time we have a uniform sample from one interval, and 90% of the time is it uniform over another interval. Trivially easy. Or do you want to see some continuous distribution that has the desired probability. For example, it would be easy enough to derive some sort of truncated exponential, such that by variation of the rate parameter, one could tailor the distribution to what you want. Or we could choose a beta distribution with the same property, and beta distributions have all sorts of shapes.
But until you explain CLEARLY what you are looking for, and what distribution you want, I've given you a perfectly valid solution in one line of code.