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

4 Ansichten (letzte 30 Tage)
Riyadh Muttaleb
Riyadh Muttaleb am 3 Jun. 2016
Kommentiert: Walter Roberson am 4 Jun. 2016
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 Kommentare
Riyadh Muttaleb
Riyadh Muttaleb am 3 Jun. 2016
Bearbeitet: Riyadh Muttaleb am 3 Jun. 2016
Hello Walter, thank you for your response. I would like to open not save.
Walter Roberson
Walter Roberson am 4 Jun. 2016
I was replying to Azzi showing how it is possible to save multiple figures in the same .fig

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Walter Roberson
Walter Roberson am 3 Jun. 2016
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.)

Kategorien

Mehr zu File Operations finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by