Stateflow: Flow chart with user input while running

3 次查看(过去 30 天)
Hi all, I have the following problem: I want to simulate a flow chart in Stateflow. Some transitions in this flow chart depend on user input, i.e. if the user answers a question with yes or no. How can I implement this user input in Simulink? I thought about using the function questdlg within my Matlab script to get the user input and hand it over to simulink by a constant block. However, this does not work, because some questions are just raised in a certain path within the flow diagram. I do not want to ask for all the answers to the questions beforehand but when the right step in the flow diagram is reached. Does somebody has an idea of how to do it?
Best regards

采纳的回答

Hendrik Lorenz
Hendrik Lorenz 2018-8-21
Found an answer to that question. The example "Modeling a Fitness Watcher" gave me a pretty good idea of how to do what I described here. Plus implementing a GUI with App Designer worked well.
https://de.mathworks.com/help/stateflow/examples/modeling-a-fitness-watcher.html

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Modeling 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by