Change constant block value using push button
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
goerk
am 17 Dez. 2015
Your code snippets look correct. Maybe you have to open/load the model first.
load_system('opc'); % or open_system('opc','loadonly')
Antworten (0)
Siehe auch
Kategorien
Mehr zu Programmatic Model Editing finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!