Force quiet a callback function on Appdesigner?
이전 댓글 표시
I am using Matlab Appdesigner and want to be able to force quiet any callback function and any subfunction with in that callback function. I added a push button to my app named Cancel and put the following code with in the sub-function of the Excute callback function to stop it when I press cancel. However it takes time to quit the excustion of the callback function (Excute) because it doesn't start quiting untill it reaches out to the line where this code is at in the sub-function.
%Check for Cancel button press
if app.CancelButton.Value == true
app.CancelButton.Value = false; % To reactive the stop button
return
end
Is there any way to add a Canceling pushbutton to the app which overwrite everything as Ctrl-C does in the Command window?
댓글 수: 8
Rik
2021년 11월 17일
Not as far as I'm aware, but you could consider calling this check more often in your code. This might have a performance penalty.
Faez Alkadi
2021년 11월 17일
Rik
2021년 11월 18일
Working from memory, so maybe this doesn't work at all: you could look into using a timer object. I believe you can stop execution of the function by deleting the object.
Faez Alkadi
2021년 11월 18일
편집: Faez Alkadi
2021년 11월 18일
Rik
2021년 11월 18일
To find out I would have to look up the documentation and maybe google something like 'stop timer function matlab'. Did you try either of those?
Faez Alkadi
2021년 11월 18일
Rik
2021년 11월 18일
I never use AppDesigner or timer objects myself either. What code did you try?
Faez Alkadi
2021년 11월 18일
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!