Stateflow: Flow chart with user input while running

2 views (last 30 days)
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

Accepted Answer

Hendrik Lorenz
Hendrik Lorenz on 21 Aug 2018
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

More Answers (0)

Categories

Find more on Simulink Functions in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!