Difference between script and matlab command window

后端 未结 2 1533
心在旅途
心在旅途 2021-01-24 06:48

I wonder what the difference is between entering a few lines in the command window, or letting a script execute them.

In the question Escape from nested try - catch sta

2条回答
  •  迷失自我
    2021-01-24 07:11

    Depending on what you mean by "doesn't work", it could just be because the debugger is a special context and certain debugger commands - dbup, dbdown, and dbquit - only work when you're at a debugger "K>>" prompt. Once you call a script, you're no longer at the debugger prompt but in normal code execution - inside a nested M-code call stack - and they just don't work there. When you F9, it does the lines individually, so each one is done from the prompt.

    As a workaround, if you really want to execute a sequence of debugger commands like this, you could write a little Java Swing widget to enter the text in to the command window just as though you were typing it in.

提交回复
热议问题