필터 지우기
필터 지우기

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

조회 수: 1 (최근 30일)
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'

채택된 답변

Walter Roberson
Walter Roberson 2013년 10월 1일
I do not know, but experiment with
set_param([bdroot '/parameter_name'],'Value','800')
Here the parameter has been changed to string.
  댓글 수: 3
Kaustubha Govind
Kaustubha Govind 2013년 10월 2일
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 2013년 10월 2일
Thanks Walter and Kaustubha. It works when I use '800' as a string.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Simulink Functions에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by