What determines the size of .fig files
18 次查看(过去 30 天)
显示 更早的评论
Hello all, my question in a nutshell is the following:
What determines the size of matlab's fig files? I encountered an extreme increase in the size of my figure files and I would like to know which I might have changed.
Long version:
I am currently facing the problem that, after coming back from holidays, the figures I am saving with matlab increased in size about 50-fold.
I am working with brain imaging data and use "fieldtrip" to produce 3D images of brain activation. The data sets used for plotting are and have always been huge (200 - 5000 MB), however the resulting figures have always been tiny (2 - 5 MB).
Lately - and I can't think of any reason for it - the .fig files I am saving are almost as large as the original datasets I am plotting (and also larger for large datasets although the resulting 3D image should be the same independent of the dataset size). I noticed this because Matlab suddenly asked me to add the -v7.3 switch to my save command because the file size started to exceed 4 GB (while being less than 5 MB before).
Since my problem may be specific for the datasets I am plotting (and I cannot post 4GB datasets or figures here) I phrased the above question in a very general way. With your answers I might be able to solve my problem.
I use Matlab 2013b and Matlab 2013a, the issue occurs with both. My figures are plotted using ft_sourceplot (fieldtrip toolbox) on a UNIX and a Windows system.
Thanks for your help, maybe you can even comment on my actual problem or on what kind of info I should post to give more insight into the problem.
Jens
4 个评论
回答(1 个)
matt dash
2014-10-9
Last I checked, saving a figure works like this: 1) use handle2struct(f) to create a structure from the figure 2) this structure is saved using the plain old "save" function, but with the extension .fig instead of .mat.
You can use handle2struct and examine the resulting structure to see what is big... though i sounds like you already know it's the data in whatever you're plotting. The structure is really just storing "get(h)" on every handle in the figure. Then you'll get whatever compression "save" does, which i think it similar to a zip file.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!