How to make an app that does not loose data when it's closed?
Afficher commentaires plus anciens
I have an app kind of a calculator. It stores data in a UITable with a special property that increases with each pressing on the button to store the data in the app. UITable and its variable are reset when the app restarted. Is there a way to prevent the them to get reset and continue from the previous work?
Réponse acceptée
Plus de réponses (1)
Angelo Yeo
le 24 Nov 2023
I understand you do not want to overwrite previous files and want to make new name everytime. I suggest you save data with time marker of present time. For example,
filename = "myfile_"+string(datetime('now', 'format', 'yyyyMMddHHmmss'))+".mat";
save(filename, 'mydata')
When you come back, you can use the latest data among the "mat" based on the filenames.
3 commentaires
piston_pim_offset
le 24 Nov 2023
piston_pim_offset
le 24 Nov 2023
Modifié(e) : piston_pim_offset
le 24 Nov 2023
Angelo Yeo
le 24 Nov 2023
If you only specify the filename, all variables in base workspace will be saved as "mat".
Catégories
En savoir plus sur Spreadsheets dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!