Can I run a bat file with Matlab?

290 ビュー (過去 30 日間)
Jorge 2011 年 1 月 27 日
コメント済み: Waldemar Gessler 2019 年 11 月 12 日
Hi! I have a bat file created to kill process:
taskkill /IM excel.exe
Can I run it with Matlab?
  3 件のコメント
Waldemar Gessler
Waldemar Gessler 2019 年 11 月 12 日
or without bat file:
system('taskkill /IM excel.exe')



Walter Roberson
Walter Roberson 2011 年 1 月 27 日
You can use system() or dos() or ! (exclamation-mark) to run a bat file.

その他の回答 (5 件)

Vieniava 2011 年 1 月 27 日
use this command:
Matlab's documentation for this function is available after
>> doc system
or on the WEB

Jorge 2011 年 1 月 27 日
I got the result I wanted. Thank you very much to both

Koteswar Rao  Jerripothula
Koteswar Rao Jerripothula 2014 年 1 月 31 日
thank from me too

Victor Villar
Victor Villar 2014 年 7 月 3 日
Very useful.

Babak babak
Babak babak 2017 年 7 月 24 日
Hi, guys when I use system or status for my batch file, it does not make outputs like when I double click on my batch file!
>> system('D:\CODE\workshop\MCNP\bab.bat','-echo')
C:\WINDOWS\system32>mcnp i=kc.i
ans =
when I double clike on my batch file, it makes for me 3 outputs.
  5 件のコメント
Walter Roberson
Walter Roberson 2017 年 7 月 24 日
Your bat file has a cd in it



Find more on Big Data Processing in Help Center and File Exchange


Community Treasure Hunt

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

Start Hunting!

Translated by