trying to open .fig file but an error shows
Show older comments
Dear Matlab experts
I have 6 figures i have generated before. Now all opens but a one which i belevie I have modified its font recently. the error message is attached. Please help if you have experienced this before.
Thank you

6 Comments
Walter Roberson
on 9 Oct 2020
The file is corrupt or something was saved over top of it somehow.
If you fopen() the file and fread() the first 128 bytes and display them as uint8 and as char(), what shows up?
Abdulaziz Abutunis
on 10 Oct 2020
Walter Roberson
on 10 Oct 2020
fid = fopen('Lift drag coefficient2.fig');
d128 = fread(fid, [1 128], '*uint8');
fclose(fid)
disp(char(d128))
disp(d128)
Abdulaziz Abutunis
on 10 Oct 2020
Walter Roberson
on 10 Oct 2020
'JFIF' is the signature for a JPEG file. Somehow a JPEG got saved on top of the .fig file.
You will need to recreate the .fig or restore it from backup (if you have it on backup)
Abdulaziz Abutunis
on 10 Oct 2020
Answers (1)
Fangjun Jiang
on 9 Oct 2020
0 votes
Some times, or many times, when you save a .fig file, there is also a .mat file saved for it. You need both files to be able to re-open the figure. I assume you didn't copy the .mat file, or they are lost, or they are over-written? Try an example to see how files are created when you save the .fig file.
1 Comment
Abdulaziz Abutunis
on 9 Oct 2020
Categories
Find more on Printing and Saving in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!