필터 지우기
필터 지우기

How can I stop execution of a live script?

조회 수: 44 (최근 30일)
Stefano Pietrosanti
Stefano Pietrosanti 2017년 8월 9일
편집: Stefano Pietrosanti 2018년 8월 28일
How can I stop execution when running a single section of a live script? CTRL+C in the command window does not seem to work, the only option seems to kill the Matlab process.
[EDIT] This issue seems to be solved in matlab version 2018a.
  댓글 수: 1
Sonia Joy
Sonia Joy 2018년 8월 27일
Try the 'return' key. It just worked for me.

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

채택된 답변

Baptiste Ottino
Baptiste Ottino 2017년 8월 9일
편집: Baptiste Ottino 2017년 8월 9일
Hi,
The function that the live editor uses to exectute a livescript is the following:
matlab.internal.richeditor.executeAndSave(filePath)
Note that filePath is the full path to the mlx file, otherwise it will return an error. If you run it in the command window, you can then interrupt the execution of the live script by using Ctrl + C, as usual. If you find the feature useful, you can program a shortcut script for it.
However, executeAndSave, as the name suggests, not only executes the mlx file, but also saves the resulting code output and figures, meaning that interrupting it can cause some unexpected errors (I have encountered one during my few minutes of testing, so they must be quite frequent), and you have to close the Matlab process entirely. Which is why I suppose the feature to interrupt live script execution wasn't added in the first place.
This answer probably won't solve your issue, but you are now at least more aware of the latent reason for it. Good luck!

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by