Handle figures without bringing them to the front

I'm using 'get' to save the name of a figure with:
h = get(figure(n),'Name')
The problem is I want to do this without having the figure window beeing brought to the front. Is there anyway to do this with the figure still minimized or at the back?

 Accepted Answer

You can do
h = get(n, 'Name')
but you might want to consider doing something like
hfig = zeros(N, 1);
for n = 1:N
hfig(n) = figure;
end
h = get(hfig(n), 'name');
This way if you have existing figures, you don't have to worry about offsets to n.

1 Comment

Yes, ofcourse I dont need the 'figure' bit and can just use n directly.
I obviously need a lunch break :) Thank you!

Sign in to comment.

More Answers (0)

Categories

Find more on Creating, Deleting, and Querying Graphics Objects in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!