Reset Constant value in Simulink from Matlab GUI
Afficher commentaires plus anciens
Hello,
In this very simplistic model of just a constant in Simulink, I wanted to RESET the value to zero by hitting the RESET button. Here is the callback code for the pushbutton control
% --- Executes on button press in RESET.
function RESET_Callback(hObject, eventdata, handles)
% hObject handle to RESET (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
set_param('email_const/Constant','Value',0);
This is a screenshot of the Simulink (just a constant block).

How to go about successfully resetting the value to zero when the pushbutton is pressed. For your convenience, I have attached all the necessary files. Thanks.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Event Functions dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!