Simscape language parameter type definition
2 次查看(过去 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!