Timer deletion Problem while closing an app in app designer
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Venkata Sai Sampath Pavan Kumar Rachumallu
am 16 Okt. 2019
Beantwortet: Ajay Gajulapally
am 26 Okt. 2022
Hi all
I have created an app having single button using app designer. On button click it will create a timer and invoke a function after a specified delay.However MATLAB is stopping the running timer when i close the app.
It throws a warning
Warning: You are deleting one or more running timer objects. MATLAB has automatically stopped them before deletion.
How can i run the timer even all closing the app?
Kindlly help. Thanks in advance.
0 Kommentare
Antworten (1)
Ajay Gajulapally
am 26 Okt. 2022
Hello,
I understand that you are trying to create an app which invokes a function based on the timer, but the timer object is getting deleted as you close the app. App designer deletes all its workspace data when you close an app, here the timer you have started is running and when you close the app, MATLAB would automatically stop the timer by force and deletes it.
App designer provides a “closeRequest” callback function, which you can find in the callbacks section when you right click the UIFigure in App designer. You can use that function and export your app designer timer variable to MATLAB base workspace using the “assignin” function. This would help you solve your timer closing problem.
Refer this on how to change the “closeRequest” callback function: https://in.mathworks.com/support/search.html/answers/229375-how-to-change-the-closerequestfcn.html
Hope this helps!!
0 Kommentare
Siehe auch
Kategorien
Mehr zu Develop Apps Using App Designer finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!