Clear Filters
Clear Filters

How to update app's text field continously using Simulink with Stateflow.

1 view (last 30 days)
I'm currently working on a project and came across a problem. The project involves an app which has a lift keyboard with numbers from 1 to 9 and a text box which I want to show the current floor. Clicking a button changes an input constant in Simulink model which then goes into a Stateflow model. The Stateflow model simulates the lift moving across the floors and updates the output "floor" and displays it in a display block. I would like to make that floor number to continously update in the text box of the app. I've searched for a solution for a while now and none worked so I hope someone could help. Thank you!

Answers (1)

Pavan Guntha
Pavan Guntha on 19 Aug 2021
Hi Damian,
I understand that the issue is with establishing proper data transfer between MATLAB App, Stateflow & Simulink.
1) You could have a look at this page which clearly illustrates how we can pass data from App designer to Simulink.
2) You could make use of events in Stateflow for state transitions which can be integrated with Floor buttons in MATLAB App through callbacks. You can have a look at the example linked below which clearly illustrates the data transfer between MATLAB App and Stateflow.
Hope this helps!


Find more on Complex Logic 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!