Questions tagged [stateflow]

StateFlow is a toolbox from MathWorks for development of state machines

Stateflow is an toolbox (extension) of Matlab from Mathworks. It is a commercial, and proprietary toolset.

Generally, Stateflow extends Simulink with the ability to design and test state machines. It is commonly used in control design, where algorithms can be either matlab scripts & formulas, simulink blocks or embedded code (in the form of so-called S-functions).

Code generation is supported on the host platform, but for target code additional tools are required (such as real time Workshop).

Advantages compared to software-only tooling (like IBM Rhapsody):

  • use with hardware (in the loop)
  • seemless integration with Simulink

Disadvantages compared to software-only tooling:

  • cost for code generation

Links:

81 questions
1
vote
1 answer

How to process vector input in StateFlow

I'm new to StateFlow and have been looking at StateFlow tutorials but have not seen one that processes vectors. My simulink model generates vectors of audio data for which I would like to process with a state machine. For example, if the audio data…
Chuck Carlson
  • 897
  • 5
  • 22
1
vote
2 answers

How to give ascii characters as input in simulink

I have to give ascii characters as input from simulink to stateflow and need to check whether the input matches with the existing ascii character. Can anyone help me to solve this? will be of a great help? Example: If I give ascii characters 'AF' as…
1
vote
3 answers

My simple simulink model runs too fast

I have designed a simple simulink and stateflow diagrams on Matlab. It works perfectly! But I have two issues: 1) The model runs too fast. The transition time between two states are amazingly fast that I can not see. I tried to change some…
user1196937
1
vote
1 answer

Matlab and simulink stateflow chart error

I have been trying to use "stateflow chart" block for hours. However, I keep getting this error: The current directory is c:\program files\matlab13\bin, which is reserved for MATLAB files. Please change your current directory to a writable…
1
vote
2 answers

Plotting multiple X,Y signals into single XYGraph matlab stateflow

i have two signals coming from my model as output each of which contain x,y values. i want to plot both of them on single xy graph window. i am able to draw it on two xy graph window but how to merge them and draw on same xy window?
bhawesh
  • 1,220
  • 2
  • 18
  • 55
1
vote
1 answer

All possible combinations for evalution of conditions

Example : if(A & B) { if(C) { } if(D) { } } We have four different states for all the conditions in this code. 0 represents False and 1 represents true state. * shows that the condition is not valid in this state flow. So…
1
vote
1 answer

How do you deselect a Stateflow element?

I'm using the Stateflow API's view method to select/highlight elements in a Stateflow chart, but I want to clear the highlight afterward. I know I can get a handle to the Stateflow object and call the view method on it to highlight it: theObject =…
rob
  • 5,947
  • 1
  • 35
  • 54
1
vote
0 answers

Clear Tag property on object copy operation

I'd like to use a stateflow object's Tag property to hold persistent data relative to that object. The problem arises when the user performs a copy of the object using a right-click/drag/release of the object. Under this (and all copy operations),…
checker
  • 63
  • 5
0
votes
0 answers

How to work with Kotlin Coroutines Flow UI State? UI State changes after screenrotation using stateflow

I created a Activity and ViewModel for to collect Stateflows to toggle views. This is my ActivityClass @AndroidEntryPoint class LoggingActivity : AppCompatActivity() { private var _bind : ActivityLoggingBinding? = null private val bind :…
0
votes
0 answers

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

I'm currently working on a project and came across a problem. The project involves an app (built using MATLAB app designer) which has a lift keypad with numbers from 1 to 9 and a text box which should show the current floor. Clicking a button…
0
votes
1 answer

How can i handle two way binding in MVI architecture?

I see many articles handling two way binding with MVVM. But i want to handle this issue with single source of truth. I dont want to create multiple stateflows for this case. I have a StateFlow which has all view state inside entity. How can i…
0
votes
0 answers

Write unit test for stateFlow

How can I write a unit test for Stateflow in the ViewModel Stateflow in ViewModel: private fun fetchLocation() { viewModelScope.launch { interactions.getLocation.invoke().collect { locationFlow.value = it } …
0
votes
1 answer

Simulink Stateflow: Wait for Parallel States

I would like to create a state machine in Stateflow that enters into multiple parallel states (A&B&C) and then exits to an end state (D) only when a condition from each parallel state has been achieved. The picture demonstrated below exits when…
Jordan McBain
  • 173
  • 1
  • 8
0
votes
0 answers

Array Value Assignment in Stateflow from Multiple Input Arrays

I am trying to build an output array based on multiple input arrays(4 of them). I have input arrays for 'boolean flag' & 'temperature'(4*2=8 inputs in total). Say the output array is an array of 5 elements, I have to assign the corresponding…
Rohan
  • 1
0
votes
0 answers

In Simulink how do I in a certain time step use all the values of one timeseries parameter before this time step?

I am trying to do this in Simulink: There are 2 parameters A and B (both are timeseries with 2 columns, one is time and the other is the value), and I would like to multiply A and B. But the thing is that I wanted to for example at time 3, multiply…
CJW
  • 11
  • 2