MATLAB: How to see how many times a button has been pressed in App Designer

button countercallback function

I'm new in matlab
I have a button in App Designer, so when it's pressed, I call a Callback
function nameButton_ButtonPushed(app)
but there isn't a variable ObjectH or EventData, how do I store how many times that button was pressed in the App?
Thanks for the help 🙂

Best Answer

Add a property to the app and increment it by 1:
app.NumberOfTimesButtonHit = 0;
In call back
app.NumberOfTimexButtonHit = app.NumberOfTimexButtonHit+1;