Borrar filtros
Borrar filtros

Why Radio Buttons in MATLAB GUI not able to set value of parameter in SIMULINK model?

1 visualización (últimos 30 días)
Hi,
Here is the code I am trying to implement to set the parameter value in SIMULINK model using GUI.
f
unction radiobutton_Callback(hObject, eventdata, handles)
val = get(hObject,'Value');
if val == 1
set_param([bdroot '/parameter_name'],'Value',800)
end
It gives me following error:
Invalid setting in Constant block 'parameter_name' for parameter 'Value'
Can anyone help me with this?
I also tried to use 'Constant' in place of 'Value' in the statement-
set_param([bdroot '/parameter_name'],'Constant',800)
but then it give this error:
Constant block does not have a parameter named 'Constant'

Respuesta aceptada

Walter Roberson
Walter Roberson el 1 de Oct. de 2013
I do not know, but experiment with
set_param([bdroot '/parameter_name'],'Value','800')
Here the parameter has been changed to string.
  3 comentarios
Kaustubha Govind
Kaustubha Govind el 2 de Oct. de 2013
Rinachi: Also pay attention to how you pass the actual value of '800' - it needs to be passed in as a string, not a number.
Rinachi Garg
Rinachi Garg el 2 de Oct. de 2013
Thanks Walter and Kaustubha. It works when I use '800' as a string.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Simulink Functions 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!

Translated by