Effacer les filtres
Effacer les filtres

How to obtain allowed values for a configuration parameter programmatically?

4 vues (au cours des 30 derniers jours)
Hi.
I am trying to analyse/study the impact of changes in configuration parameter settings programmatically, for our Simulink model and auto generated code. I know how to set the configuration parameters programmatically, for example
set_param(configObject,'DefaultParameterBehavior','Inlined');
I also know how to obtain all configuration parameters programmatically:
get_param(configObject, 'ObjectParameters')
Now, for the study it would greatly help if I could obtain the allowed values for each parameter, for example DefaultParameterBehavior can be Inlined or Tunable, according to the help documentation (https://nl.mathworks.com/help/rtw/ref/defaultparameterbehavior.html). Is there any way of obtaining these allowed values programmatically? Such that the result will be something like
{'Inlined','Tunable'}
Thanks in advance!

Réponse acceptée

Selena Mastrodonato
Selena Mastrodonato le 2 Fév 2024
You can access these informations with get_param(object,'DialogParameters'). It gives you a struct with all parameters and every parameter has a field Enum with accepted values.
  3 commentaires
Selena Mastrodonato
Selena Mastrodonato le 2 Fév 2024
I don't know if this can be useful, but if you use this command get_param(0,'ObjectParameters'), you'll obtain global and model parameters, included configuration parameters.
Rene Vugts
Rene Vugts le 2 Fév 2024
Yes this works! Thank you very much :-)
>> opbjectParam = get_param(0,'ObjectParameters');
>> opbjectParam.DefaultParameterBehavior
ans =
struct with fields:
Type: 'ConfigSet_Opt_DefaultParameterBehavior_EnumType'
Enum: {2×1 cell}
Attributes: {'read-and-controlled-write' 'read-only-if-compiled'}
>> opbjectParam.DefaultParameterBehavior.Enum
ans =
2×1 cell array
{'Tunable'}
{'Inlined'}

Connectez-vous pour commenter.

Plus de réponses (1)

Osama
Osama le 28 Fév 2024
how i can configuration the compounant

Catégories

En savoir plus sur Deployment, Integration, and Supported Hardware dans Help Center et File Exchange

Produits


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by