Simscape language parameter type definition
조회 수: 4 (최근 30일)
이전 댓글 표시
I am currently designing customized Simscape components and I have had some trouble trying to find a way to define the type of parameter to appear in the component mask (writing it in the components' ssc files), such as: edit (default), checkbox, pop up (on/off or true/false I have seen as feasible)... In particular I am interested in the checkbox type.
I have read through the Simscape Language guide and I have not found any reference to define such type. If someone could help me with this issue I would very much appreciate it. Thanks in advance.
댓글 수: 0
답변 (1개)
Sabin
2025년 8월 13일
A checkbox in Simscape language can be defined in the parameters section by using a logical value:
parameters
param1 = false
end
For dropdowns you can use enumerations in component parameters and you can specify user-friendly strings to be displayed in the block dialog:
classdef damping < int32
enumeration
direct (0)
derived (1)
end
methods(Static)
function map = displayText()
map = containers.Map;
map('direct') = 'By damping value';
map('derived') = 'By no-load current';
end
end
end
You can then use this enumeration in a component parameter, for example:
parameters
r_damp = damping.direct; % Rotor damping parameterization
end
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Custom Components에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!