Filter löschen
Filter löschen

Simulink switch that is based on probability

2 Ansichten (letzte 30 Tage)
George Jacob
George Jacob am 12 Sep. 2019
Kommentiert: Jim Riggs am 17 Sep. 2019
How do you use Simulink to create a pathway with a switch that splits into two based on probability (for eg, 0.4 of the time goes through port A and 0.6 of the time goes through port B)?

Akzeptierte Antwort

Jim Riggs
Jim Riggs am 13 Sep. 2019
Bearbeitet: Jim Riggs am 13 Sep. 2019
This seems to work for me (The uniform random number is set to a range of 0 to 1):
  2 Kommentare
George Jacob
George Jacob am 14 Sep. 2019
Thanks so much! Looking forward to trying it but this was exactly along the lines of what I was thinking. I’m trying to create a Markov chain model similar to what is possible with TreeAge Pro
Jim Riggs
Jim Riggs am 14 Sep. 2019
Bearbeitet: Jim Riggs am 14 Sep. 2019
I'm thinking that one way to implement this in a subsystem like this:
Matlab Answers 20190913a.JPG
In this case, the enabled subsystems simply pass the signal straignt through. Signals A and B are defined outside, and the subsystem simply acts a a probabilistic switch between A and B.
You can create a mask for the subsystem and set the percentage threshold (i.e. the 0.4 value) in the mask.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

George Jacob
George Jacob am 16 Sep. 2019
Thanks again! This was very helpful !!
  4 Kommentare
George Jacob
George Jacob am 17 Sep. 2019
Sorry about that. I’m a nube. Hopefully I did it right this time.
Jim Riggs
Jim Riggs am 17 Sep. 2019
Thank you.
For future reference, you should not post an answer to your own question, unless you are offering a solution that no one else has offered and that best fits the question. Put your comments in the comment section.
Also, feel free to "vote" for answers that are helpful/interesting to indicate that they have value.(you can vote for as many answers as you like)

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Discrete-Event Simulation finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by