Simscape language parameter type definition
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
Sabin
le 13 Août 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 commentaires
Voir également
Catégories
En savoir plus sur Custom Components dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!