issue while setting mask parameter

16 次查看(过去 30 天)
Anuj
Anuj 2024-10-30,7:42
回答: Gayatri 2024-10-30,7:53
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,7:53
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 中查找有关 Create Block Masks 的更多信息

产品


版本

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by