trying to open .fig file but an error shows

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

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?
Thank you Walter for the help
fid=fopen('Lift drag coefficient2.fig') gave me 4
fid2 = fread(fid) gave my a line column
fid = fopen('Lift drag coefficient2.fig');
d128 = fread(fid, [1 128], '*uint8');
fclose(fid)
disp(char(d128))
disp(d128)
Walter this what i hace after I ran the script
ans =
0
ÿØÿà JFIF ÿÛ C
$.' ",#(7),01444'9=82<.342ÿÛ C
2!!22222222222222222222
Columns 1 through 19
255 216 255 224 0 16 74 70 73 70 0 1 1 0 0 1 0 1 0
Columns 20 through 38
0 255 219 0 67 0 8 6 6 7 6 5 8 7 7 7 9 9 8
Columns 39 through 57
10 12 20 13 12 11 11 12 25 18 19 15 20 29 26 31 30 29 26
Columns 58 through 76
28 28 32 36 46 39 32 34 44 35 28 28 40 55 41 44 48 49 52
Columns 77 through 95
52 52 31 39 57 61 56 50 60 46 51 52 50 255 219 0 67 1 9
Columns 96 through 114
9 9 12 11 12 24 13 13 24 50 33 28 33 50 50 50 50 50 50
Columns 115 through 128
50 50 50 50 50 50 50 50 50 50 50 50 50 50
'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)

Sign in to comment.

Answers (1)

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

There are other figures generated by the same code run and they are openning. I have never seen a .m file generated accompnying a saved .fig file.
Thank you

Sign in to comment.

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!