This video covers how to use control-c to interrupt programs that won't otherwise quit. This works exactly as shown in Octave as well. This video is part of a series comprising a complete introductory course in Matlab / Octave.
The full playlist is here: https://www.youtube.com/watch?v=NxHHtjB3UQQ&list=PLg3AZRFBfHLU0QyUzJ5TH1AkXeLIQ_zSm
Google drive link to all Matlab code: https://drive.google.com/drive/folders/1G2EKVimWhjRacAEMl_K9yMtcvAFf0xkm?usp=sharing
A direct link to the code used in this video is here: https://drive.google.com/file/d/1cz3wNwvWMUj7TLa2BXf6d23Re2FyIMN-/view?usp=sharing