How to check the current line (debug)

조회 수: 13 (최근 30일)
Mateusz
Mateusz 2012년 4월 10일
답변: Pruthvi G 2019년 3월 20일
I often use 'keyboard' command to debug my programs (since sometimes I have to use command line and matlab -nodisplay setup). When the keyboard command is reached, the execution is stopped until I type return or dbquit. Sometimes, however, I would also like to know where the execution has been stopped, that is which function/script, which line. This might help me to trace down all keyboard instructions that I have put and that are reached during the execution. It this possible in Matlab R2011b?

채택된 답변

Sean de Wolski
Sean de Wolski 2012년 4월 10일
Perhaps dbstack()?
doc dbstack
  댓글 수: 1
Mateusz
Mateusz 2012년 4월 10일
Looks this is what I need, thanks!

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Pruthvi G
Pruthvi G 2019년 3월 20일

카테고리

Help CenterFile Exchange에서 Entering Commands에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by