I am currently using the built in random number generator.
for example
nAsp = randi([512, 768],[1,1]);
512 is the lower bound and 768 is the upper bound, the random number generator chooses a number from between these two values.
What I want is to have two ranges for nAsp but I want one of them to get called 25% of the time and the other 75% of the time. Then gets plugged into he equation. Does anyone have any ideas how to do this or if there is a built in function in matlab already?
for example
nAsp = randi([512, 768],[1,1]); gets called 25% of the time
nAsp = randi([690, 720],[1,1]); gets called 75% of the time
I assume you mean randomly 25% of the time? Here’s one easy way to do it:
If you know you’re generating N of these, you can do