Update variables by simulink conditional statement

U1 is yellow and u2 is blue
According to the if condition statement, when u1=100u2=0, the true interval is 10 to 50 seconds.
However, looking at the final result value(upper picture is the final one), it is converted to 1 from 10 seconds to the end.
That's my guess.
1. If conditional statement is wrong.
2. "Once" if statement is true at 10 seconds, the value is not updated and is "continued" 1.
I think number 2 is the most likely one
Is there a way to keep updating input values so that the result values are exported 1 value for 10-50 seconds only?

 Réponse acceptée

Fangjun Jiang
Fangjun Jiang le 18 Août 2023

0 votes

Inside the If Action subsystem, double click the Outport block, there is an option for "Output when disabled", choose "reset" instead of "held".

3 commentaires

Oh thank you. but It have another error
'led/If Action Subsystem1/Out1' must be configured to retain its own output because no initial output is specified
Then specify the initial value at the same dialog window
okay thank you so much

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Create Large-Scale Model Components dans Centre d'aide et File Exchange

Produits

Version

R2023a

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by