Instead of "continue", try "break".
Here's my reasoning:
"continue" temporarily interrupts the execution of a program loop, skipping any remaining statements in the body of the loop for the current pass only.
So it doesn't exit the loop completely, it skips any remaining code in the loop and then re-evaluates the condition of the while loop, which in your case is always true.
In contrast, break exits the loop completely.
Another way to go about it is to rewrite your loop statement, for example:
a = 0;
while a~=2
a = a + 1;
end
Not sure why it wouldn't cease running with ctrl-c though. I expect that your script has run for such a long time that your machine might be getting progressively less responsive. Hinted by this article: http://www.mathworks.com/help/matlab/matlab_env/stop-execution.html