Is it possible to recover a corrupted *.mlapp file?
9 次查看(过去 30 天)
显示 更早的评论
I was working on an app and had just got the thing to work when the file became corrupted. When I tried to run the file (and now when I try to open it), I get an error dialog:
"Error loading 'PlotDigitizer.mlapp'.
And then this appears in the command window:
"Error using which
C:\Work\Matlab\Apps\Plot Digitizer\PlotDigitizer.mlapp: Can't open file.
Error in run (line 55)
pathscript = evalin('caller', strcat('which(''', script, ''')'));"
I tried to find a solution to this online and came up with reseting preferences... which didn't work.
This the second time this has occured, forcing me to loose several hours of work, and I am not even sure what I did to cause it, if anything. It seemingly worked one minute and then not the next.
Is App Designer that unstable? Is there a way to recover this or at least copy the text portion of the code?
Also, what options do I have for backup or autosave?
2 个评论
采纳的回答
Robert Philbrick
2022-8-15
编辑:Robert Philbrick
2022-8-15
The app became corrupt due to an invalid character entered on line 413:
if(c == <escape character here>) % Exit when Esc key is pressed
The "escape" character that you used is not supported in the MLAPP code file. This is a bug and I have reported it to the App Designer team.
I fixed the app (attached) so that it will now load by removing the escape character and replacing it with 'escape'. A better way to detect if the user has pressed the escape key is to add a KeyPressFcn to your app's UIFigure and use the event.Key in the callback to determine if escape was pressed:
function UIFigureKeyPress(app, event)
key = event.Key;
% Check if key == 'escape'
end
8 个评论
Sai Sandeep Chigurupati
2024-5-6
Does the attached temp file give any clue?
Robert Philbrick
2024-5-7
@Sai Sandeep Chigurupati that zip file seems invalid as well and not recongized as a zip file. I would recommend that you contact customer support (https://www.mathworks.com/support/contact_us.html).
更多回答(1 个)
Max Scharrenbroich
2024-4-4
If the .mlapp is corrupted you can still recover user-defined code and other things by opening the .mlapp as an archive using 7-zip.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Environment and Settings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!