How can I determine if a Simulink built-in block dialog parameter is evaluated?

3 次查看(过去 30 天)
No problem for user-created Masks:
With user-created masks, the Mask object (e.g. Simulink.Mask.get(gcb)) contains a MaskParameter array called "Parameters" that details everything about the mask dialog parameters including whether the parameter's "Evaluate" is set to 'on'. Also for blocks with user-defined masks, the block parameter 'DialogParameters' returns a structure that includes an Attributes array which will not include 'dont-eval' if the mask parameter is evaluated.
% Select a block with a user-defined mask
p = get_param(gcb,'DialogParameters');
fieldNames = fieldnames(p);
p.(fieldNames{1}).Attributes
But nothing works for built-in blocks:
Built-in blocks like the Inport also have parameter dialogs and support the 'DialogParameters' block parameter. However, the attributes of the DialogParameters do not appear to indicate whether the parameter is evaluated or not. For example the Inport block has a 'PortDimensions' dialog parameter that clearly accepts variable names to be evaluated. However, the attributes of the PortDimensions dialog parameter indicate 'dont-eval'.
So - is there a way to determine whether a built-in block's dialog parameters are actually evaluated, because the mechanism that seems like it's supposed to tell us looks WRONG!?
% Select an Inport block
p = get_param(gcb,'DialogParameters');
fieldNames = fieldnames(p);
p.(fieldNames{10}).Attributes

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Simulink Functions 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by