-3

As mentioned in this question, one can open a new figure that is fit to the screen using the command

figure('units','normalized','outerposition',[0 0 1 1])

Assume now that some script has generated figures figure(1), figure(2) and figure(3) and you want to programmatically select figure(2) and fit it to the screen.

A possibility would be to use the mentioned command instead of figure inside the script that generates the figures, but assume that you cannot (or do not want to) modify this script. You really want to select one of the already existing figures. How would you do that?

Community
  • 1
  • 1
Karlo
  • 1,630
  • 4
  • 33
  • 57
  • 3
    I'm voting to close this question as off-topic because this is an *extremely* trivial difference from the initial post and adds no intellectual value to stack overflow. – Suever Jun 02 '16 at 10:55
  • @Suever I understand though I asked it because I really did not know how to programmatically select a window and then close it. I did not think of the easy `h=figure(2)` command and thought that I had to modify something to the `set` statement. Sometimes, questions do not have a lot of intellectual value but are meant to help the OP with something that is new to him, although it might be trivial for others. – Karlo Jun 02 '16 at 13:05
  • 2
    I understand that it is something that you didn't understand, but this exact thing (changing graphics properties on an existing object) has been asked *ad nauseam* here on SO. Maybe I should have voted to close as a duplicate instead. – Suever Jun 02 '16 at 13:20
  • 2
    Possible duplicate of [MATLAB: Changing the line properties of a loaded figure?](http://stackoverflow.com/questions/9329611/matlab-changing-the-line-properties-of-a-loaded-figure) – Karlo Jun 02 '16 at 13:53

1 Answers1

0

It seems to be easier than I thought:

h=figure(2)
set(h,'units','normalized','outerposition',[0 0 1 1])
Karlo
  • 1,630
  • 4
  • 33
  • 57