Is there a way to switch between two command windows?

In a Matlab session, I call another matlab command window (say 2nd matlab) by using the command "!matlab -nodesktop -nosplash -r "myfunc" &" . After returning back to the first matlab session, I want to go back to the 2nd matlab once more to run "myfunc". However whenever I call "!matlab -nodesktop -nosplash -r "myfunc" &" new matlab command window is opened. Is there a way to switch between two matlab command windows?

답변 (1개)

Asim
Asim 2024년 9월 25일

0 개 추천

Hello Kaan,
Unfortunately, MATLAB does not provide a built-in way to switch between multiple command windows once they are opened. Each time you use the !matlab -nodesktop -nosplash -r "myfunc" & command, it starts a new instance of MATLAB.
However, you can use MATLAB’s matlab.engine API. This allows you to start and control MATLAB sessions from Python or Java programmatically. You can start a MATLAB session, run commands, and then reconnect to the same session later.
I hope it helps!

카테고리

도움말 센터File Exchange에서 Call MATLAB from Python에 대해 자세히 알아보기

질문:

2017년 2월 22일

답변:

2024년 9월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by