6. Debugging
PROFESSOR: This is [? Doctor ?] MATLAB, Lecture 6, debugging. We will use the function Fibbo2 to demonstrate some basic debugging. The first thing you want to do when you debug is set a breakpoint at an interesting line. We'll set it at the very first interesting line of the function. Since Fibbo2 is not in the current folder nor in the path, MATLAB pops up this download box and asks us whether we should add it to the path or simply change folder. We're going to change folder. So now that we've changed folder, MATLAB was willing to put a breakpoint. And now if we run Fibbo2 with 3, we will get stopped right here with the green arrow on the breakpoint. Notice that at this point, n is defined to be 3 because that was the input we get gave Fibbo. F is still not defined, and v is not defined either. After we do this one line, F will be defined. How do we do this one line? We have to either click on Step, or Step In, or Step Out, or Continue. All these things are s...