How to close the current figure only?

조회 수: 46 (최근 30일)
Meshooo
Meshooo 2014년 4월 3일
편집: Meshooo 2014년 4월 3일
Dear all,
I am have a push button which was created by uicontrol. I want this figure only to be close after the push button is done. I tried to add 'close all' to my code but this will close all figures.
uicontrol('Style', 'pushbutton', 'String', 'SAVE',...
'Position', [20 20 50 20],...
'Callback', ...
@yourCallback); % what do you want to do?
function yourCallback(ObjH, EventData)
I = getimage;
setappdata(0, 'I', I);
restoGui; %the name of the GUI where the image to be transfer
clc
close all % will close all figures, but I want to close the current figure only
Any idea how to do that?
Thanks for any help.
Meshoo

답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2014년 4월 3일
You can use
close
  댓글 수: 1
Meshooo
Meshooo 2014년 4월 3일
편집: Meshooo 2014년 4월 3일
To make things clearer; I have a figure that shows the result image and in this figure I added the push button as I described above.
When this push button is clicked, I want the image to be transferred to another GUI which I call 'restoGui' and close this figure.
Adding 'close' only will close the main GUI 'restoGui' which I don't want.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by