Error in Stateflow diagram
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
iwan soenandi
el 3 de Nov. de 2015
Comentada: iwan soenandi
el 4 de Nov. de 2015
i want to use stateflow diagram to simulate optimization control to prevent the rate of reaction, but there is still error in diagram, could anyone help me?. The diagram can be changed and any rule can be used just for example and testing. Thank you

0 comentarios
Respuesta aceptada
Sebastian Castro
el 4 de Nov. de 2015
The error message tells you what's wrong: There are 2 outputs that the chart has to produce, but the chart in its current state never assigns any value to them. So, when the Reactor block tries to look at its "heater" and "stirrer" signals they come up empty.
You need to add assignment operators to either the states
entry:
RPM = 1000;
Temp = 20;
or to your state transitions
{RPM = 1000; Temp = 20;}
As long as you do at least once at the beginning, Simulink will have stored values for RPM and Temp and this will remove the error. Typically you want to initialize your outputs to default values (usually zero) and then update them at certain points in your chart logic.
- Sebastian
Más respuestas (0)
Ver también
Categorías
Más información sobre Stateflow 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!