How to use a variant sink depending on its input
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Bicheng Guo
am 13 Dez. 2018
Bearbeitet: Bicheng Guo
am 15 Dez. 2018
I have a s-function and it has 6 outputs, the next step is to check is there a negtive in 6 outputs. If there is one negtive, the simulation should be stop. If there is not, the 6 outputs should be passed to next s-function to continue simulating. In this case, I choose a variant sink, one of the output connects to stop block and another connects to next s-function to continue simulating. The thing is how can I use variant sink depending on its input rather than a pre-defined varable.
The pic shows how I use the variant sink, but it has an error saying that both the h and y (two of the outputs of s-funtion) are not defined.
Thank you very much!
0 Kommentare
Akzeptierte Antwort
Fangjun Jiang
am 13 Dez. 2018
I think the "Variant Sink" block is un-necessary. If you want to stop the simulation when any of the output goes nagative, then you need to feed (or with some pre-process first) the output to the Stop block all the time. So the Stop block is constantly checking the value and stop the simulation when the condition is met. At the same time, also feed the output to the next s-function.
6 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Model, Block, and Port Callbacks finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!