Simscape language parameter type definition

5 views (last 30 days)
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.

Answers (1)

Sabin
Sabin on 13 Aug 2025
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

Categories

Find more on Custom Components in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!