close
Close one or more figures
📝Syntax
close()
close('all')
close(name)
close(ID)
close(GO)
close('all', 'force')
close(ID, 'force')
tf = close(...)
📥Input Arguments
Parameter Description
ID a scalar integer value: figure ID.
GO a scalar graphics object on an existing figure.
GO a scalar graphics object on an existing figure.
📤Output Arguments
Parameter Description
tf a scalar logical: true if figure was closed.
📄Description

close closes the current figure.

close(ID) closes the figure specified by figure ID.

close(GO) closes the figure specified by figure graphics object.

close('all') closes all figures.

close(..., 'force') closes the specified figures even when a CloseRequestFcn callback would otherwise prevent them from closing.

💡Examples
f = figure(1)
close();
h = figure(3)
close(h)
f1 = figure()
f2 = figure()
close('all')
🔗See Also
gcffigure
🕔Version History
Version Description
1.0.0 initial version
Edit this page on GitHub