90 questions
0
votes
0
answers
29
views
Designing a Start/Stop Mechanism for a Stateflow State Machine
I have modeled a simple state machine in Stateflow (Simulink). I want to start the state machine with an external signal (start). When activated, it should set the flag FSM = 1, indicating that the ...
0
votes
0
answers
24
views
Repeated data collection in Jetpack Compose using StateFlow
I have a list of products, and when I click on a product, I fetch details from the database and display them in a detail screen. I'm using Jetpack Compose and StateFlow to manage the selected product.
...
0
votes
0
answers
56
views
Simple Stateflow model is not functioning
I have designed a basic State-flow model. When I'm trying to run the model, I'm getting an error message
Invalid connection from output port 1 of constant to Input port, Ports are not compatible and ...
2
votes
1
answer
268
views
Simulink transitions and superstates, will you go back to the outside state?
I have a system setup like the sample stateflow:
Condition1 Occurs and we go to Sub1. If Condition3 then occurs will it bring us back to Test1? Similarly if we get to sub2 through Condition1 and ...
0
votes
0
answers
96
views
Call user defined C functions on every state transition in matlab state flow
After designing my state machine using matlab state flow and generating its C code using code generation, I could easily run it in my application in visual studio. However, after a while I needed to ...
0
votes
1
answer
266
views
How to run two states in parallel after a given time is met?
I have a very simple example. Two fans (A and B) are in a facility, representing each as a state. State Fan B will enter after 20 seconds state Fan A starts working. Therefore, after 20 sec, state ...
0
votes
1
answer
383
views
Accessing Simulink Functions from inside Atomic Subchart
For reasons far outside my control, I have now been thrust into doing MATLAB/Simulink/Stateflow work. I've done the On-Ramp training, and already I despise how unintuitive it is to do things that are ...
1
vote
0
answers
221
views
How can I get the port number of a Matlab StateFlow input given it's handle programmatically?
I have the handle of a StateFlow input from a previous find result. I'm trying to get the port number for that StateFlow input. I've been using the sf('get',[handle#],[field name]) command for ...
-1
votes
1
answer
65
views
Simulink Stateflow: add invariants to state
Hi I am creating a hybrid automata model using Stateflow. I was wondering if it's is possible to add invariants to a state?
1
vote
1
answer
328
views
Build state machine with 2 variables
I am new with Modelica but I would like to build an easy state machine with 2 variables :
The initial step is "off" (the variable Light_cabin==0) then if button_Evac == 1 (second variable) ...
1
vote
1
answer
4k
views
How to resolve'updates persistent or state variables while computing outputs, therefore it cannot be used in an algebraic loop....' error with Charts
I have a Model with 2 charts created with code. My first chart is a test simulation which go to a TIMER EXPIRED state when TimerStatus = 1;. The error occurs with my timer chart :
When I try to ...
0
votes
1
answer
157
views
cannot use the 'machineformat' input argument on calling loadMNISTImages function from simulink
I am calling the simple CNN which classifies the MNIST images. The CNN internally calls loadMNISTImages() functions to read images from a file. When this CNN is connected to my simulink model.
I am ...
0
votes
1
answer
114
views
Is it possible to use tlc while do stateflow design in MATLAB Simulink?
The tlc can be saved as text file and has tracebilty.
Is it possible to using tlc in stateflow design?
Or Any other suggestion to keep the tracebilty feature in sateflow project?
0
votes
3
answers
8k
views
Transition Action and Condition Action in Stateflow
In the below two state charts , the first one has an action to perform when it moves from StateA to StateD , ie. /{z=5};
and the second one has to perform the action {z=5};
I understand that this is a ...
0
votes
1
answer
661
views
How to generate state flow condition?
I am trying to create a state machine (state flow). The input is a vector.
The condition for a switch in one direction is:
[vector(vector < 494 | vector > 631)]
and for the other direction:
[...
0
votes
1
answer
2k
views
How can I used Event-Based Temporal Logic in MATLAB/Simulink Stateflow?
I'm looking for a way to use event-based temporal logic in Simulink Stateflow.
Example: [State_1] --> [after(3,sec) && e] --> [State_2]
Scenario:
0 sec: State_1 is active
2 sec: e is ...
0
votes
1
answer
242
views
What built-in options for documentation are there in MATLAB? [closed]
I'm looking for a way to document the code and models created or generated by MATLAB (m-files) Simulink models (S-functions etc.) and Stateflow. In the last five years I was using Octave so I'm not ...
0
votes
1
answer
3k
views
How to concatenate multiple signals into one signal?
I have multiple signals which are In-ports to a subsystem with different datatypes.I am using State flow to develop a function where I have to use these in-ports and compare with some constants or ...
0
votes
1
answer
201
views
Visualizing a Stateflow Model
I have a pretty simple MATLAB stateflow model that I would like to visualize. I don't need anything fancy - even if I could just display a different image based on which substate a parallel state is ...
0
votes
1
answer
730
views
Simulink Stateflow - 'after' condition not precise?
I implemented an integrator (grounded capacitor driven by piece-wise constant current source) using Stateflow and the 'after' condition. See code.
With the given setting the capacitor should change ...
0
votes
0
answers
2k
views
How to design a counter with reset in simulink and stateflow
Design a counter that decrements and increments by 1 with rest option which means it rests to zero and starts the counting from one.this problem should be done using both simulink and stateflow.
0
votes
1
answer
414
views
Write to DataStore from Matlab script
So what I'm trying to do is this: I have a simulink stateflow model. To display some stuff from this model I built a GUI. In this GUI I have a button that should set a flag to true when pressed, which ...
1
vote
1
answer
123
views
Close Stateflow editor programmatically
Is there a way to close (or hide) a Stateflow Editor programmatically?
I could not find any hint about this in the documentation or the net. The only way I know of is to close the model entirely, but ...
1
vote
1
answer
603
views
How can I extract the location of the Stateflow blocks in a given Simulink model?
I have a Simulink model and I would like to extract the location of the Stateflow blocks it contains. I am looking for a command inspired by this command that gives the total number of blocks. How ...
1
vote
1
answer
3k
views
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 ...