Simscape language parameter type definition
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Sabin
el 13 de Ag. de 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
0 comentarios
Ver también
Categorías
Más información sobre Custom Components en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!