Show Line Number in Error Message

后端 未结 1 1505
一整个雨季
一整个雨季 2021-01-21 11:54

On most instances of MATLAB I\'ve used, whenever I had a bug in my code the error message in the command window would show the line number.

However on the computer I am

相关标签:
1条回答
  • 2021-01-21 12:10

    What you are doing is using Run Section or Run and Advance as @canzar said. If you run scripts like this there is no 'line number', just as when you copy-paste code and run it in the command-window will not show you the line number on the error.

    If you run the script using run or by pressing F5 it does know the line number and then prints that on the error statement. Good to know for debugging is to go to the tab editor->breakpoints->dbstop on error. If you press that it will keep your variables as present when the memory occurs, as opposed to throwing everything out when debugging functions.

    0 讨论(0)
提交回复
热议问题