Is it possible to save a corrupted .mlapp file?

4 次查看(过去 30 天)
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.

采纳的回答

Image Analyst
Image Analyst 2023-5-8
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 个评论
Image Analyst
Image Analyst 2023-5-8
编辑:Image Analyst 2023-5-9
@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 2023-5-10
@Image Analyst, thanks for update and making the feature request; does seem to be a significant oversight in the UI.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 File Operations 的更多信息

产品


版本

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by