Hi,
I am going to point you towards the progressbar. It can be configured to have a Cancel Button that would stopp a for loop. see the Example "Update Wait Bar Message and Add Cancel Button"
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!