How to execute an .m file from the command line in windows without opening a new matlab copy
이전 댓글 표시
The problem is, I want to execute a certain .m file from the command line. I know how to do already:
matlab -nosplash -r "run whathever.m"
Problem is, this opens a new instance of Matlab, I don't want that, I want it to simply use the already open instance of Matlab. Is there any way of doing that?
댓글 수: 3
Sandra
2018년 12월 13일
Hi,
I have got the same problem. Is there meanwhile a way to solve it?
Matt Merkley
2020년 5월 5일
You can add -nodesktop to your call.
matlab -nosplash -nodesktop -r "whathever"
Walter Roberson
2020년 5월 6일
Using -nodesktop can prevent a new graphical interface from starting up, but this is not quite the same as using an existing MATLAB instance. In particular, if you used an existing MATLAB instance, you would have access to the state of that instance, such as the contents of the base workspace and global workspace. In theory one could even wish to run a command line that affected the graphics of an existing session.
채택된 답변
추가 답변 (1개)
Shizuka
2013년 3월 7일
0 개 추천
댓글 수: 2
Kaustubha Govind
2013년 3월 7일
Shizuka: Sorry, that's the only way that I can think of. Perhaps you need to have admin privileges when you attempt to start MATLAB as a COM Server?
Walter Roberson
2020년 5월 6일
Also, COM server only applies to MS Windows.
카테고리
도움말 센터 및 File Exchange에서 Write COM Applications to Work with MATLAB에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!