How can I determine if a Simulink built-in block dialog parameter is evaluated?
조회 수: 6 (최근 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
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Component-Based Modeling에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!