How do I set a flag on Simulink?
Mostra commenti meno recenti
I'm trying to model a relatively simple mechanical system using Simulink, but there is a particular parameter (call it f) which seems to need computing logic that would normally require flags. Basically, if f ever exceeds a value, say 100, a separate parameter (call it s), has to evaluate to TRUE. Then, s must remain TRUE until f drops below another value, say 50. How could I go about modeling this in Simulink?
In MATLAB, the logic would go something like this, checking continuously for f:
s=0; %Initial Condition
if f>100
s=1;
end
if f<50
s=0;
end
Risposta accettata
Più risposte (1)
Dalton L'Heureux
il 12 Giu 2020
0 voti
A relay block works great as already seggested. But incase anyone wants to do a similar thing using only basic logic blocks, you can define a simple latch as shown below:

Categorie
Scopri di più su Simulink in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!