필터 지우기
필터 지우기

How to let Matlab execute bat file at the bat file directory.

조회 수: 10 (최근 30일)
Jacky
Jacky 2014년 4월 25일
댓글: Jacky 2014년 4월 25일
Hi,
I have two bat files I want to run simultaneously through a matlab script,which also generate some output files.
I use command line as below:
dos('C:\sim\folder1\run.bat &')
dos('C:\sim\folder2\run.bat &')
However, when I run the matlab script using the code above, both the bat files are run in 'C:\sim' because my matlab script is saved in 'C:\sim'. How do I execute the bat files in different directory with my matlab script?
  댓글 수: 1
Jacky
Jacky 2014년 4월 25일
I have found a solution. Create a function with
dos('C:\sim\folder1\run.bat &')
as code in at same folder with the bat file ans use command run in the main matlab script.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 File Operations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by