Azzera filtri
Azzera filtri

What happens when an ouput port is connected to an unmerged signal after an "if/else" logic?

2 visualizzazioni (ultimi 30 giorni)
I've come accross examples of models with output ports connected only to the "if" side of an if/else logic without the signal being merged beforehand.
  1. I wonder why such a model is allowed to build and if specific configuration parameters must be set to allow it.
  2. Also, how does Simulink deal with the undetermined output at runtime (when in the "else" case of the logic, to which the output port is not connected) ? In the examples I saw, it seems that the models would just return "Nan" in that case.
  3. And finally, I'm curious as to how this is dealt with when generating C code from such a model.

Risposte (1)

Walter Roberson
Walter Roberson il 16 Set 2022
The if block contains a setting that controls the value of the output when the block is not selected.
If I recall correctly one of the choices is to hold the last value; I do not recall the other choice at the moment.

Categorie

Scopri di più su Simulink Coder in Help Center e File Exchange

Prodotti


Release

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by