Is it possible to save a corrupted .mlapp file?
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Ricardo Burbano Escolà
le 8 Mai 2023
Commenté : dpb
le 10 Mai 2023
It all was working well until I tried to use the "save" function to save a variable. When I tried to run the code, it suddenly froze, so I closed the project. When trying to open it again, it displayed the following message: "Error loading LANXI_DAQ.mlapp". Also, this is what appears in the Matlab Command Window:
I stumbled upon someone that had a similar problem, and could edit the .mlapp file by converting it into a .zip and editing the contents inside, but I hasn't worked for me. Any ideas on how could this issue be solved? I attach all the project files just in case someone knows how to fix it.
Thank you in advance.
0 commentaires
Réponse acceptée
Image Analyst
le 8 Mai 2023
The problem is you gave the name of your .mlapp file as the name for your MAT file when you saved it. This is a disaster. Basically, because you did not change the name of the file to give it an extension of ".mat" instead of ".mlapp" you overwrite your .mlapp file. This is not recoverable. Hopefully you have a backup. Look for a file called LANXI_DAQ.asv. If that file is not there then you will have to rebuild your app from scratch. Hard lesson to learn, but make sure you really know what the filename is of the mat file you are trying to create. You should have done this:
% Get base file name of the .mlapp file.
[folder, baseFileNameNoExt, ext] = fileparts(mfilename('full'))
% Get a new filename for the output .MAT file that has a .mat extension.
matFullFileName = fullfile(folder, [baseFileNameNoExt, '.mat'])
4 commentaires
Image Analyst
le 8 Mai 2023
Modifié(e) : Image Analyst
le 9 Mai 2023
@dpb yes, that does seem bizarre that backups are only made for .m (and maybe .mlx?) files and not for .mlapp files. I've sent tech support a question about whether this oversight is an intentional feature or a bug.
[UPDATE] Tech support tells me that there is no capability for App Designer to automatically save backup files like the regular editor does. 😢 I've put in a feature enhancement request for it.
The best they could suggest was to check the box in the Preferences->App Designer to have it save the file if you ever navigated away from App Designer, but that won't create a second/older copy, it just does an immediate save.
dpb
le 10 Mai 2023
@Image Analyst, thanks for update and making the feature request; does seem to be a significant oversight in the UI.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur File Operations dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!