필터 지우기
필터 지우기

How to interrupt a callback while it's calling another function?

조회 수: 2 (최근 30일)
Niko
Niko 2015년 1월 13일
댓글: Niko 2015년 1월 14일
Hi All,
The callback of a GUI button in my program calls another function (which takes a long time to run). Is there a way to interrupt this callback while that other function is running? It seems like setting 'Interruptible' to 'on' only works within that callback...
Thanks,
Niko

채택된 답변

Image Analyst
Image Analyst 2015년 1월 13일
You can set a global variable that the routine checks periodically. See the FAQ for methods to do that: http://matlab.wikia.com/wiki/FAQ#How_can_I_share_data_between_callback_functions_in_my_GUI.28s.29.3F
  댓글 수: 1
Niko
Niko 2015년 1월 14일
just added some pauses to the other function and it solved the problem... seems like you need to manually introduce some 'intervals' for MATLAB to process that interrupting callback. Thanks for your help!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by