Is it possible to save a corrupted .mlapp file?

4 visualizaciones (últimos 30 días)
Ricardo Burbano Escolà
Ricardo Burbano Escolà el 8 de Mayo de 2023
Comentada: dpb el 10 de Mayo de 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.

Respuesta aceptada

Image Analyst
Image Analyst el 8 de Mayo de 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 comentarios
Image Analyst
Image Analyst el 8 de Mayo de 2023
Editada: Image Analyst el 9 de Mayo de 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
dpb el 10 de Mayo de 2023
@Image Analyst, thanks for update and making the feature request; does seem to be a significant oversight in the UI.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre File Operations en Help Center y File Exchange.

Productos


Versión

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by