Debugging the SPOT GUI - Carleton-SRCL/SPOT GitHub Wiki

Context

In a perfect world, the graphical user interface for SPOT would never fail, and would be portable across MATLAB versions. Unfortunately, this is not the case. Though it is possible for a GUI developed in one version to be ported to a newer version, it is unlikely to work (for example using the 3.07 GUI in MATLAB 2021a will result in an error around the .cla property for the animation panel...).

How to Debug

If you need to debug the GUI, it is exactly like any other script. Simply double click on GUI_v4_0_X_Main.mlapp (or any of the other sub-applications) and it will open the App Designer:

image

By default, the designer will open on the "Design View", to see the actual code navigate to the "Code View". You can then scroll throughout to find the desired function. Note, that you can also navigate to a function directly in the "Design View" by right clicking on a button, clicking on "Callbacks", and then "Go to ___ callback". This will bring you directly to the code that is executed when that GUI function (button, menu option, etc.) is clicked:

image

To actually debug the GUI, you can simply click on the left hand side (see below) to place a debug stop point, the same way you would for any other MATLAB script or function:

image

When you next execute that code, you will enter debug mode. Note that the GUI is considered it's own function, so you will only see variables created by the GUI in the workspace (in other words, if you had a variable present before debugging, it will not show up when the debugger is pausing within the GUI code).