MATLAB: How to fix code

editingfix?

I am using matlab for the first time. When I make a mistake or a fat finger but do not catch the mistake before hitting enter, is there a way to go back and fix this? My teacher says he does not know of a way other than re typing entire program again. Seems odd that if you get all the way through your program and there is a typo that you have to completely reenter all code.
Thanks!

Best Answer

You are entering your text into a text editor window aren't you? You're not just typing a bunch of lines into the command window are you? So if you're in the text editor, you just make any changes and then hit F5 or click the green triangle. If it's running and you need to stop it early, type control-c. If you hit a 4 and really wanted a 2, just type backspace to get rid of the 4 and then type 2. These are my guesses because you've confused two of us now as to what you actually mean. I'm sure you've used a word processor before or typed things into the computer so I don't really know what the issue is, because this is so basic.