execution a program step by step

Hi all I have already written a program that its some parts doesn't give me desirable answers. I want to run this program line by line and check the results step by step.
How can I do???
Best

Antworten (1)

Fangjun Jiang
Fangjun Jiang am 14 Okt. 2011

0 Stimmen

Open you .m file in M-editor, move your cursor to a line and press F12. You will see a red dot in that line just left of the line number. You can click the place to turn on/off the break point too. Then press F5 to run the code. Click menu Debug for more options.

3 Kommentare

Vishnu Sahay
Vishnu Sahay am 15 Dez. 2017
This merely puts in a breakpoint at the step. Now how do I run that step? Hitting F5 only continues with rest of execution of the code.
Walter Roberson
Walter Roberson am 15 Dez. 2017
dbstep to execute one line.
dbstep in to step into a function being called on the current line.
Stephen23
Stephen23 am 15 Dez. 2017
Bearbeitet: Stephen23 am 15 Dez. 2017
To step though code while debugging use the buttons or commands shown in the documentation:
Because the keyboard shortcuts can be changed you should look these up on your installed MATLAB (see the link above). Try F10.

Melden Sie sich an, um zu kommentieren.

Kategorien

Tags

Gefragt:

som
am 14 Okt. 2011

Bearbeitet:

am 15 Dez. 2017

Community Treasure Hunt

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

Start Hunting!

Translated by