cancelling waitbar insdie a gui function
이전 댓글 표시
Hello everyone, I am having some problem with waitbar defined inside a gui script. The problem is I have created a waitbar with cancel option which was working fine outside. But when I pasted it inside my gui.m script the cancel button is not working (rest all is fine). Below is the code I have used:
pvh=waitbar(0,'calculating.....','name','ESTIMATION',...
'createcancelbtn','setappdata(pvh,''cancel_callback'',1)');
setappdata(pvh,'cancel_callback',0);
for count_i1 = 1:l_count
if getappdata(pvh,'cancel_callback')==1
errordlg('Stopped by user');
break;
end
waitbar(count_i1/ l_count,pvh,sprintf('Calculating %d %s %d',count_i1,'of', l_count))
I went through some help of MATLAB and tried some options like drawnow or updating the handles of the waitbar figure. Looks like I did not do it properly. Any suggestions on how to make it work? thanks in advance.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 App Building에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!