MATLAB Answers

0

How can I click a push button programmatically in App Designer?

Asked by Anshuman Agrawal on 31 Jul 2019
Latest activity Answered by Kojiro Saito on 1 Aug 2019
One of my pushbuttons when clicked does a bunch of calculations and I was wondering how to 'click' it in some other part of my code.
I know that I can create a helper function instead but I wanted to know if it was possible to just 'click' the button programmatically.

  0 Comments

Sign in to comment.

1 Answer

Answer by Kojiro Saito on 1 Aug 2019
 Accepted Answer

You can call the button pushed callback function programmatically, so if your callback looks like this,
% Button pushed function: Button
function ButtonPushed(app, event)
% Do something
end
you can call it by the following.
ButtonPushed(app, matlab.ui.eventdata.ButtonPushedData)

  0 Comments

Sign in to comment.