Mask-like editor for all parameters in the Simulink model

조회 수: 2 (최근 30일)
Radoslaw
Radoslaw 2024년 6월 11일
답변: Fangjun Jiang 2024년 6월 11일
Is there a way to conveniently have a dialog to edit all the parameters in the model in a single place?
I have a model consisting of several MATLAB functions connected with other Simulink blocks. Each of the MATLAB function have several inputs set as parameters - some of these are unique to chosen function block, while others are shared between multiple blocks. I am looking to edit all of these parameters from a single place within the Simulink.
I've tried some workarounds but none of them seem to work sufficiently well. I know that I can initialize the variables in the Init Callback or directly in the Matlab workspace, but switching between Simulink and Matlab windows or entering Callbacks menu just to tune some parameters isn't very convienient. I have also tried to connect functions to Write Parameters blocks and to initialize all parameters in the single section of the model, but Write Parameters doesn't seem to work with MATLAB functions (even when masked). I've also tried to use Dashboard Edit block to change values of the paramters, but it still required me to first initialize them in the main Matlab workspace. Another workaround (probably the closest to what I want to achieve) is to enclose the entire model in a single mask, but the configuration of this mask is another inconvenience and I would have to open this mask everytime to make any changes in the structure of the model.

답변 (1개)

Fangjun Jiang
Fangjun Jiang 2024년 6월 11일
At your Simulink model, press Ctrl+H to open the Model Explorer. Click Base Workspace, there you can see all variables and edit them.

카테고리

Help CenterFile Exchange에서 Model, Block, and Port Callbacks에 대해 자세히 알아보기

태그

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by