Simulink/Stateflow: Variable value cannot by changes in model

조회 수: 25 (최근 30일)
Marco
Marco 2024년 11월 14일 8:47
댓글: Marco 2024년 11월 14일 9:35
Hi all,
I am working on a large simulink model consisting of several submodels, where the core logic is controlled by a stateflow chart, using MATLAB 2023B. From one to another day, I cannot change any code oder algorithms concerning the simulation output in the Data Inspector.
Example:
I just add a local variable and change the value from 0 to 5, somewhere in my model. The state is reached, but the variable value is not switched.
I did not changed any configs and did not update some matlab versions.
However, I cannot find any solution since I do not have any ideas how to tackle the problem or find a solution.
Best,
Marco

답변 (1개)

Manikanta Aditya
Manikanta Aditya 2024년 11월 14일 8:56
Hi Marco,
I understand that you are encountering issue with your Simulink model where the core logic is controlled by a stateflow chart, using MATLAB R2023b.
Try to follow the following steps and see if this helps.
  • Ensure that your Stateflow chart is correctly detecting changes in the variable values. You can use operators like hasChanged, hasChangedFrom, and hasChangedTo to detect changes in data values.
  • If you are using operating points to save and restore the state of your model, ensure that you are correctly modifying the values of local, output, or persistent data.
  • Use the Model Explorer to manually inspect and change the values of variables in your model workspace. This can help you verify if the changes are being applied correctly.
Refer to the following documentation to know more about:
I hope this helps you.
  댓글 수: 1
Marco
Marco 2024년 11월 14일 9:35
Hi Manikanta,
Yes, you understood it right and thanks a lot for the tips, I tried all but cannot track any changes of variables I am changing in the code.
If I just add 5 to a variable at some point, it stays at its initial value.

댓글을 달려면 로그인하십시오.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by