Mask parameter does not evaluate

I am trying to define a mask parameter for a Simulink block so that its value is the index in a pop-up list.
'Select a parameter' some_param Pop-up Evaluate Tunable
However, regardless of whether I check the box Evaluate, some_param remains the string value of the popup rather than the index.
Does anyone know why this would happen? (I am running Matlab/Simulink 2009a)

1 commentaire

Jarrod Rivituso
Jarrod Rivituso le 5 Avr 2011
Is there any code in your initialization tab or in the dialog callback of the parameter?

Connectez-vous pour commenter.

Réponses (2)

Kaustubha Govind
Kaustubha Govind le 6 Avr 2011

0 votes

Do you mean that when you use get_param on the parameter, it always return the string of the selection - AFAIK, this is intended behavior. Is there a reason you want to get the index instead?
You could always use the popup string values returned by:
get_param(gcb, 'MaskStyleString')
or
get_param(gcb,'MaskStyles')
To find the relative index of the string value.
Fangjun Jiang
Fangjun Jiang le 6 Avr 2011

0 votes

I don't have R2009a, but I tried in both R2007b and R2010b. As long as you check the box for "Evaluate", the index value is returned. If "Evaluate" is unchecked, then the string value is returned. This is expected as it is documented.
I don't know what happened in your case. Double check, or maybe post some screen shot?

Catégories

Produits

Question posée :

Sy
le 5 Avr 2011

Community Treasure Hunt

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

Start Hunting!

Translated by