How can I open a specific figure from 'file.fig'?

3 次查看(过去 30 天)
I have 'file.fig' contains about 500 figures I would like to open just one specific figure like number 200, without open all, How can I do that?
Thanks in advance,
Riyadh
  5 个评论
Riyadh Muttaleb
Riyadh Muttaleb 2016-6-3
编辑:Riyadh Muttaleb 2016-6-3
Hello Walter, thank you for your response. I would like to open not save.
Walter Roberson
Walter Roberson 2016-6-4
I was replying to Azzi showing how it is possible to save multiple figures in the same .fig

请先登录,再进行评论。

回答(1 个)

Walter Roberson
Walter Roberson 2016-6-3
I have just gone through the code, and the answer is NO.
Loading a .fig file is done by using load() on the .fig file, which is really a .mat file in disguise. The load() is the built-in routine that cannot be accessed, and it goes through and recreates all of the figures. It does this in the course of loading a single structure. In current .fig files, the structure name is hgM_070000 where the number might be different for older versions (it is a MATLAB version number); for some older .fig files, the structure name is hgS followed by a version number. One of the graphics objects stored in a field has the figures stored in it.
I thought about the possibility of using matFile to be selective about what is loaded from the .fig file, but you might recall that matFile does not allow one to be selective about which fields of a structure are loaded.
The closest that I can see to do: in R2014b or later, if you add an InstanceCreated listener to the metaclass of matlab.ui.Figure then the listener will fire for each figure created; you could potentially check each one as it was created and delete each if it wasn't the one you were interested in (though clearing it instead of deleting it might be needed to have everything else work out.)

类别

Help CenterFile Exchange 中查找有关 Interactive Control and Callbacks 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by