step by step track running of Gui

18 views (last 30 days)
Hamza
Hamza on 21 Jul 2016
Commented: Hamza on 22 Jul 2016
I have code to work on, where there is GUI called in the main .m file like:
DataCollection();
The DataCollection is GUI, there are other functions also and the GUI is using those functions. In order to understand the working of the GUI, I want to track run the step by step process of the GUI. But, when I reach to line where the GUI 'DataCollection();'is called, the GUI opens and after that I cannot track what is going on.
Can anyone here guide me to so that I will be able to run the GUI step by step. actually I want to understand the code of the GUI. so I want to know that is going on in the background on run time.
  1 Comment
Hamza
Hamza on 21 Jul 2016
I figured it out.
the normal step in method work until the function where the GUI is initialized. after that it opens the GUI and you don't know how to do the step in anymore, so we have to put another break point right at the start of the next function in the GUI. then it will work.
Thank you every one ..

Sign in to comment.

Answers (2)

KSSV
KSSV on 21 Jul 2016
There is a debug option in matlab......explore debug
  2 Comments
Hamza
Hamza on 21 Jul 2016
I know about that, but once the GUI start, how to follow the run flow of code.
say I press a push button, a code is run at the background. I want to follow that.
KSSV
KSSV on 21 Jul 2016
debug option does that......you can track which line matlab is executing...... Once you are in debug mode...evry time you have to press next step button to execute the next line....

Sign in to comment.


Walter Roberson
Walter Roberson on 21 Jul 2016
Put a breakpoint on the first executable line of your code . Click Run. When it pauses at that breakpoint, the edit window will show several possibilities:
Continue
Step
Step In
Step Out
Run To Cursor
You can Step each line until you find the call to your GUI. At that point you can Step In and you will enter the GUI and be able to debug it.
  1 Comment
Hamza
Hamza on 22 Jul 2016
I figured it out.
the normal step in method work until the function where the GUI is initialized. after that it opens the GUI and you don't know how to do the step in anymore, so we have to put another break point right at the start of the next function in the GUI. then it will work.
Thank you every one ..

Sign in to comment.

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!