function interruptibleUI
figure('Position',[400,500,329,160]);
uicontrol('Style', 'pushbutton',...
'String', 'Compute',...
'Position', [24 55 131 63],...
'Callback', @longComputation,...
'Interruptible','on'); % On by default anyway
uicontrol('Style', 'pushbutton',...
'String', 'Pause',...
'Position', [180 55 131 63],...
'Callback', @interrupt);
end
function longComputation(src,event)
pause(15);
end
function interrupt(src,event) % depending on where you want to stop
dbstop in interruptibleUI at 19