how to reset and reload app in AppDesigner

23 visualizzazioni (ultimi 30 giorni)
Trop Trader
Trop Trader il 16 Feb 2024
Risposto: Ishaan Mehta il 26 Dic 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

Risposte (1)

Ishaan Mehta
Ishaan Mehta il 26 Dic 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!

Categorie

Scopri di più su Develop Apps Using App Designer in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by