Saaru Lindestøkke
Saaru Lindestøkke

Reputation: 2544

How to get figure name without displaying the figure?

In Matlab I can get the figure name by using:

get(figure(1), 'Name')

where I now get the first figures name. However with this method the figure pops up and becomes visible, even though I have set set(0,'DefaultFigureVisible','off').

How can I get the figure name without showing the figure on screen?

Upvotes: 1

Views: 634

Answers (2)

tashuhka
tashuhka

Reputation: 5126

In case you don't know the handler:

get(get(0,'Children'),'Name')

Upvotes: 0

Eitan T
Eitan T

Reputation: 32930

Try using the figure handle itself instead of invoking figure:

get(1, 'Name')

Upvotes: 2

Related Questions