What Should Happen when a Live Script is Executed from the Command Line?

I have a Live Script myscript.mlx. I accidentally used myscript as a command on the command line
>> myscript
As soon a I hit enter, I realized that I had no idea what was suppose to happen? Should the LiveScript editor open with the script executing? Something else?
As it turned out, nothing happened. I got the "Busy" status in the lower left of the Matlab window. Waited a while and when nothing seemed to be happening I tried to get back control with ctrl-c, and opening the Live editor and clicking on Stop. Nothing happened. Eventually had to end the Matlab process (Win 10).

 채택된 답변

Cris LaPierre
Cris LaPierre 2022년 2월 20일
편집: Cris LaPierre 2022년 2월 20일

0 개 추천

It should run your script. Any lines of code without a semicolon will print their output to the command window, and any figures will open in figure windows.
Just note, though, that for figures, live scripts keep reusing the same figure unless you explicitly tell it to create a new figure. Inside the live script, you will see a snapshot of your figure anytime you modify it. However, when you run the live script from the command window, only the final figure is displayed.

댓글 수: 1

OK. I just quit Matlab, restarted, and tried it again. It worked exactly as you said. No idea what was different this time.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Entering Commands에 대해 자세히 알아보기

제품

릴리스

R2021b

질문:

2022년 2월 20일

댓글:

2022년 2월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by