How do I open my matlab figures?
5 次查看(过去 30 天)
显示 更早的评论
"Error using open (line 163) Unable to read MAT-file C:\Users\user\Documents\MATLAB\u.fig: not a binary MAT-file. Try LOAD -ASCII to read as text."
I saved the figures but while some can be opened, others are not and they come up with the message as given above. I don't know what to do. I also observed that while the good ones are in the size range of 20kb, these ones that cant be opened are in the size range of 50 to 60kb. I tried renaming but it wont work.
Some of the files are attached. The u'2.fig files are the problem files. The v'2.fig are good. Please do try to open them and advice me what to do.
Many thanks
Lawrence
0 个评论
回答(1 个)
Stephen23
2015-2-12
编辑:Stephen23
2015-2-12
First I removed that ' from the names, this will only make things confusing in MATLAB.
Lets investigate this by opening the files in a text editor:
The file v2 starts with the line MATLAB 5.0 MAT-file, Platform: PCWIN, ... and continues with a whole lot of binary data. This is a healthy .FIG format.
The file u2 starts with ÿØÿà JFIF.... This is clearly not a .FIG format. What is more, JFIF stands for "JPEG File Interchange Format", which is not a .FIG file.
4 个评论
Stephen23
2015-2-12
编辑:Stephen23
2015-2-12
"I don't know how they got a JFIF file extension": actually they all have the .FIG extension. The question is: how did they all end up with the .FIG extension?
It is important to understand the difference between an image and a figure:
- an image ( .PNG, .JPG, etc) can be opened by imread and saved by imwrite. There are lots of other image manipulation functions too.
- a figure contains the data required to create a MATLAB figure. A figure can be saved using saveas or savefig, and read using open.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Printing and Saving 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!