필터 지우기
필터 지우기

Change constant block value using push button

조회 수: 1 (최근 30일)
Nikolay Panasetsky
Nikolay Panasetsky 2015년 12월 3일
댓글: goerk 2015년 12월 17일
Hello everyone)
I want to change the value of constant block in Simulink from 0 to 1 and vice versa using push button in GUI.
function pushbutton2_Callback(hObject, eventdata, handles)
c=1
set_param('opc/Constant','value',num2str(c))
  댓글 수: 2
Madhu Govindarajan
Madhu Govindarajan 2015년 12월 9일
Could you explain more on what is working and what is not?
goerk
goerk 2015년 12월 17일
Your code snippets look correct. Maybe you have to open/load the model first.
load_system('opc'); % or open_system('opc','loadonly')

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by