Disclaimer: I've never used the app designer. Maybe mathworks have changed how things work compared to the 'old' gui tools.
Matlab is single threaded. That means it can only do one thing at once. Therefore, when it is executing a loop, it's not going to respond to user events. Therefore, once your code has entered your loop it's going to look like the app is frozen as you never give a chance to matlab to check that your ptButton has changed state.
The fix for that is normally to insert a drawnow in your loop. drawnow tells matlab to actually update figures (without it, you won't see the changes made by your plot) and process the user events such as button clicks.