issue while setting mask parameter

조회 수: 2 (최근 30일)
Anuj
Anuj 2024년 10월 30일
답변: Gayatri 2024년 10월 30일
The "set_param" function will only update the model if the mask dialog is closed. If the mask dialog is open, the "set_param" command might not take effect, especially if the parameter is visible.

답변 (1개)

Gayatri
Gayatri 2024년 10월 30일
Hi Anuj,
To modify mask parameter values, use the 'Simulink.Mask' class.
% Get the Mask of the Subsystem
maskObj = Simulink.Mask.get('TestModel/SubSysName');
% Retrieve the Mask Parameter
paramObj = maskObj.getParameter('parameter_name');
% Set the Parameter Value
paramObj.set('Value', 'NewValue');
Please refer the below documentations for Simulink.Mast class:

카테고리

Help CenterFile Exchange에서 Author Block Masks에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by