how to reset and reload app in AppDesigner

23 views (last 30 days)
Trop Trader
Trop Trader on 16 Feb 2024
Answered: Ishaan Mehta on 26 Dec 2024
I click on Button "Avvio Predator" and it load app..
Inside in my app i want to reset and reload it..
How can i do it?
i try o call this function to reset it :
function ResetTableButtonPushed(app, event)
app.startupFcn(app);
end
but it give me error

Answers (1)

Ishaan Mehta
Ishaan Mehta on 26 Dec 2024
Hi Trop,
One of the ways to implement a restart functionality in MATLAB App Designer absed application is to delete "app.UIFigure", and then call the app again.
For instance, if you application's name is "SampleApp", you can add a "Button" element in the user interface and a dd a "ButtonPushedFcn" callback to it, when is executed when the button is clicked. "ButtonPushedFcn" can hve the following content:
% Button pushed function: RestartButton
function RestartButtonPushed(app, event)
delete(app.UIFigure);
SampleApp;
end
Now, The app will be restarted when the user clicks on the button.
Hope this helps!

Categories

Find more on Develop Apps Using App Designer in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!