Why? Because you are not doing it correctly? What can I say? Maybe you are just running a really old version of MATLAB. Most likely, you just don't understand how to use these capabilities of MATLAB.
I'll asume this is a script.
First, split the code into pieces. Do that by inserting a blank line in the script, with a double % symbol at the beginning of the line. Put the line where you want to break the code into segments. Like this:
So your code might now look like this:
Ok. I'll assume your script is more complicated than that, but who cares? :)
Now, in the editor, if I click the mouse inside the first segment that entire piece becomes hilighted in yellow. At the top of the editor window, the bar will have a button that is called "Run Section". If I click on run section, then it runs that section, and ONLY that section or block of code. In fact, I can run it again. And any variables that exist in your workspadce are available for use there.
Or, I can click on "Run and Advance". That will run the current section, but then it will highlight the next block of code.