Stateflow while-logic dead loop
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Dingxin Wang
el 28 de Mzo. de 2024
Editada: Fangjun Jiang
el 29 de Mzo. de 2024
I'am using stateflow to model a system.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1653981/image.png)
With this logic i am expecting if the input is 1, the output should be 1. If the input is not 1, do nothing (it'a one-time logic, if the input is once not 1, the output will be none from then).
I used a step signal from 1 to 2 as an input. But the simulation can't proceed since its a dead loop at first time step. Why is that and how to solve this?
2 comentarios
Respuesta aceptada
Fangjun Jiang
el 28 de Mzo. de 2024
When input==1, you do have an infinite loop, right?
Connecting the feedback transition to the bottom junction would resolve it.
2 comentarios
Fangjun Jiang
el 29 de Mzo. de 2024
Editada: Fangjun Jiang
el 29 de Mzo. de 2024
See this for Stateflow while-loop. You don't have anything to change the condition. Any time when input==1, it will fall to the infinite loop trap.
Más respuestas (0)
Ver también
Categorías
Más información sobre Complex Logic en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!