Could somebody help me to implement an algorithm with stateflow?
2 views (last 30 days)
Apeksha Bagrecha on 20 Sep 2022
The idea would be to retain the information of the variables in a state between time steps and then use that information to add or shift elements accordingly. There are various ways of doing it and one possible approach would be to call Graphical Functions in States, where in each call to the function, the entire loop is executed and data written to the array accordingly.
The attached example (testRingBuffer_TS.slx) implements a ring buffer of size 5 using the graphical function in states of a Stateflow chart.
Additional information on Graphical Functions can be found at our documentation page
>> web(fullfile(docroot, 'stateflow/flow-graph-algorithm.html'))
Benjamin Thompson on 19 Sep 2022
Please start with the Stateflow Onramp Training on the Mathworks website. Then try to implement your algorithm and if you have specific problems post a new question with sample files attached.