uiresume
일시 중지한 프로그램 실행 재개
설명
예제
버튼을 누르면 실행 재개하기
누름 버튼을 생성하여 사용자가 누를 때까지 대기합니다. 그러면 메시지가 표시됩니다.
누름 버튼을 계속 텍스트 및 콜백(누름 버튼을 클릭하면 uiresume
함수를 호출하는 콜백)과 함께 생성합니다. 프로그램 실행이 시작되면 명령 창에 메시지를 표시합니다. 사용자가 계속을 클릭하거나 Figure 창을 닫을 때까지 프로그램 실행을 일시 중지합니다. 그러면 새 메시지가 표시됩니다.
fig = uifigure; btn = uibutton(fig); btn.Text = 'Continue'; btn.ButtonPushedFcn = 'uiresume(fig)'; disp('This text prints immediately'); uiwait(fig) disp('This text prints after you click Continue');
함수 호출을 사용하여 실행 재개하기
알림 대화 상자를 만들고 응답 변수를 받을 때까지 대기한 다음 프로그램 실행을 계속합니다.
UI Figure에 선 플롯을 만들고 알림 대화 상자를 표시합니다. 응답 변수를 받으면 figure에 대한 uiresume
함수를 호출하도록 대화 상자에 CloseFcn
콜백을 지정합니다. 사용자가 대화 상자에서 확인을 클릭하거나 닫을 때까지 프로그램 실행을 일시 중지합니다. 프로그램 실행이 다시 시작되면 명령 창에 메시지를 표시합니다.
이 함수를 실행하려면 MATLAB 경로에 있는 resumeInFunction.m
이라는 파일로 저장합니다. resumeInFunction
을 실행하고 누름 버튼을 클릭하면 MATLAB이 명령 창에 메시지를 표시합니다.
function resumeInFunction fig = uifigure; fig.Position = [500 500 500 350]; ax = uiaxes(fig); plot(ax,1:10) uialert(fig,'A line plot was created in the axes.', ... 'Program Information','Icon','info','CloseFcn',@alertCallback) uiwait(fig) disp('Program execution resumed') function alertCallback(src,event) uiresume(fig) end end
콜백의 입력 인수를 지정하는 방법에 대한 자세한 내용은 Create Callbacks for Apps Created Programmatically 항목을 참조하십시오.
입력 인수
f
— figure 객체
Figure
객체
figure 객체로, Figure
객체로 지정됩니다. figure
함수나 uifigure
함수를 사용하여 이 객체를 생성합니다.
버전 내역
R2006a 이전에 개발됨
MATLAB 명령
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 MATLAB 명령을 지원하지 않습니다.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)