필터 지우기
필터 지우기

Stateflow states ordering in Data Inspector

조회 수: 4 (최근 30일)
Federico Toso
Federico Toso 2023년 5월 19일
답변: Atharva 2023년 6월 21일
When you use a Stateflow chart within Simulink framework, there is the possibility to log the active state. Then, once the simulation has been completed, you can see the results using the Data Inspector. The logged states are plotted along the y-axis, versus time on the x-axis.
I am wondering if there is the possibility to re-order the state labels along the y axis, i. e. to specify which ones are showed on the top and which ones on the bottom. I found out that the default ordering is not always the most useful

채택된 답변

Atharva
Atharva 2023년 6월 21일
Hey Federico,
In Simulink, the Stateflow chart provides a way to log the active states during simulation and view the results using the Data Inspector. By default, the logged states are plotted along the y-axis in the order of their appearance in the Stateflow chart. However, it is not possible to directly reorder the state labels along the y-axis in the Data Inspector.
To change the ordering of state labels in the Data Inspector, you would need to modify the Stateflow chart itself. The order of appearance of states in the chart determines the order in which they are displayed in the Data Inspector. Therefore, you can rearrange the states in the chart to achieve the desired order in the Data Inspector.
Here are the steps to rearrange the state labels:
  1. Open the Stateflow chart in Simulink.
  2. Double-click on the Stateflow block to enter the Stateflow Editor.
  3. In the Stateflow Editor, you can click and drag the states to change their positions in the chart. Dragging a state up or down will change its order in the Data Inspector.
  4. Rearrange the states according to your preferred order.
  5. Save the Stateflow chart and run the simulation again.
  6. Once the simulation is complete, open the Data Inspector to view the reordered state labels.
By rearranging the states in the Stateflow chart, you can control the order in which they appear along the y-axis in the Data Inspector and achieve a more useful arrangement for your specific needs.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Complex Logic에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by