You are on page 1of 1

DEBUGING

In my experience working with the students, it was very obvious that their
debugging skills were lacking. I know when I was in Models there was a debugging
lesson however I personally feel as if it wasnt enough to actually teach me how to
debug. I learned how to debug during my first co-op because I exclusively use
MATLAB there.
I have two things that I think would benefit the students. First is the debug
on error option. At the top of the MATLAB window under the editor tab, is a
breakpoints drop down menu. Near the bottom of this drop down is a debug on
error option. I think it would benefit students to always have this option enabled or
at least shown what this does. Essentially when they run a command or script, if it
errors out it will go directly to the line it errored out at. More than anything I think
this is convenient when searching for errors and sometimes can save time if it is a
simple mistake thats hard to see.
Secondly, and more importantly, the operation of the debugger built into
MATLAB. When I was in models this was not taught to me and based on what I
asked the students, it was not taught to them either. (It is also important to know
how to use this when using the debug on error option as it opens the debugger)
On any line of code in a script, a red circle can be placed to the left of a line. When a
script is run and gets to the line with the circle it will stop at that line and keep all
variables that were made. When running scripts by themselves this is less
important, however when making GUIs and running them, variables tend to
disappear after a successful run. Because of this, if something is going wrong in a
GUI but it isnt erroring, it can be very hard to tell where the problem is or what you
should be working with because the variables are not there anymore. The debugger
solves this and I believe it is essential to know how to use it when making GUIs.
During the GUI projects, I had to show students how to use the debugger
MANY times to fix their problems. I think that at some point the students need a
video or a lab teaching them how to use the debugger. The lab could be just giving
the students a GUI that doesnt error out but isnt doing what its supposed to. To fix
it they would have to use the debugger. This would probably be a models 2 task.
However in models 1 I think the debug on error option could be taught to the
students in the debugging lesson.

You might also like