Access .mlapp data in .m file after app closes
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Jonathan Avesar
am 5 Jun. 2020
Kommentiert: Tommy
am 8 Jun. 2020
Hello,
I have a script (.m) that calls a app (.mlapp) that I created using AppDesigner. The app is designed to collect user input. After the user enters the values, he/she clicks an OK button which propmpts the app to close. After the app closes, I want to access the user data from the app in the scipt (.m) and perform operations with the data. How do I do this?
I tried creating "public" properties and storing the values in the said created public properties, but I cant access those properties after the app is closed because the handle is deleted when the app deletes. I understand that it is possible to transfer data before the app deletes but the problem with that is that I don't know when the user is finished entering the data until the app is deleted.
My code in the script (.m) looks something like this:
H = myApp;
waitfor(H)
%Here I need to access the data from myApp
0 Kommentare
Akzeptierte Antwort
Tommy
am 5 Jun. 2020
Rather than waitfor(H), which waits until H is deleted, how about waitfor(H,propname,propvalue), where propname is some property of H that gets set to propvalue once the user is finished entering data? And delete your app after you've grabbed the relevant properties, rather than from within the app.
2 Kommentare
Tommy
am 8 Jun. 2020
Awesome! I am super glad that worked, this was a bit of a fun one. Happy to help as always!
Weitere Antworten (0)
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!