Unable to set/get uisimvartuner's variables (Simulink/Appdesigner)

조회 수: 1 (최근 30일)
Marc
Marc 2025년 5월 13일
편집: Govind KM 2025년 7월 23일
This is for a GUI used to drive a simulink simulation.
The uisimvartuner widget works as expected: Block parameters from the simulink model appear in the UI.
These parameters' values can be changed before / during the simulation. The simulation clearly uses the updated parameters through the uisimvartuner as soon as these are changed.
To write a simulink data dictionary I want to get the values from all the variables in the uisimvartuner, but cannot find a way of accessing those from the UI code section in appdesigner.
The Block parameters values were defined as variables in the model workspace. If one of the variable gets adjusted in the uisimvartuner widget before/during the simulation, the model workspace is not updated with the new value.
  댓글 수: 2
Hitesh
Hitesh 2025년 5월 14일
Hi Marc,
"uisimvartuner" (Simulink Variable Tuner widget) allows you to interactively tune block parameters during simulation, but these parameter values are managed internally by the simulation engine and are not automatically reflected in the model workspace or accessible as simple variables from MATLAB code running outside the simulation context.
Marc
Marc 2025년 5월 14일
Thanks Hitesh,
Is it possible at all to retrieve the values from "uisimvartuner" (Simulink Variable Tuner widget) or that the simulation is using?

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

채택된 답변

Govind KM
Govind KM 2025년 7월 23일
편집: Govind KM 2025년 7월 23일
Hi Marc,
The block values modified via the "uisimvartuner" component can be accessed from the "Variables" property of the "simulink.Simulation" object. You can add a button which, when clicked, reads the desired values from the "Variables" property and writes them to a file.
More information on the "simulink.Simulation" object can be found in the following documentation page: https://www.mathworks.com/help/releases/R2024b/simulink/slref/simulink.simulation.html#mw_460d5250-0e5e-4ef1-be5f-fe91e9631113

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기

제품


릴리스

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by