Here are the basics - I've got a model with a computed distance between 2 objects. The likelihood that object A will detect object B is a probability dependent on distance (and its a cumulative lognormal curve).
I want to include a probability function based on that computed distance. So that at X meters, the probability of detection is 20%. At Y distance its 50% etc. At each step of the model, the distance will be different, so it needs to redo its random draw from the probability function and output whether or not object B was detected.
I was under the impression that the uncertain state block within the robust control toolbox was the direction to go, but so far I haven't been able to decipher the "help" information to learn how to use and apply it. (And as far as I can understand, it would be ideal b/c I can also run the model varying all the uncertain variables a certain number of times from the command line).
There are Uniform and Normal Random Number blocks in Simulink you can use to create a random draw (assuming you want this to change with each step). You can setup a comparison for random detection (1's and 0's) like this in simulink:
Unfiform Random Number block with minimum set to 0 -> Quantizer with interval set to one
This will output 1's and 0's with 50% chance of either.
To achieve a 20% detection rate you could do copy what's above, set the max of uniform random number to 4 and after the quantizer use a compare to zero block setup as ==0
Since the odds of a zero out of the quantizer should be 1/5 the output of the compare to zero should be true 20% of the time. You can repeat a similar process for any % you want.
See this page for more info: Monte Carlo Simulation with MATLAB and Simulink