How to execute multiple m files in current project from command line in windows?
이전 댓글 표시
Hi,
I have got a large simulink project an multiple m files to run in this project. At the moment I start to first m file which loads the project with the following command
matlab -r "run('matlabfile1.m')"
in windows command line. When matlabfile1 finished the file closes itself but not the simulink project. In the next step I would like to run the second (and more) m file in the same project.
I have the following ideas:
- run a matlab file automatically when opening it. Perhaps there exists a way to implement that
- run the next matlab file in a new matlab instance and communicate between the matlab instances so that the file is able to run the simulink project
- run a seperate matlab file in the background which is watching for commands (perhaps from windows command line) to run different matlab files
Are there some ideas to solve my problem?
댓글 수: 3
What does "the file closes itself" mean? Which file closes what?
What does the "it" mean in "run a matlab file automatically when opening it"?
If you start a new Matlab instance for each M-file and "communicate" with a formerly existing Matlab session, you will end at N open Matlab sessions for N m-files. This will exhaust your memory soon.
Sandra
2018년 12월 14일
Jan
2018년 12월 14일
Why do you open the editor at all if you want to run the code?
exit is equivalent to quit.
I'm still not sure about what the problem is. Do you want to start a bunch of scripts one after the other without closing Matlab?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Whos에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!