How can I run a for loop with !myfile.exe?

I am running a .exe file in Matlab without a problem, but I am having trouble using it in a loop with different input arguments each time it runs.
This how the command looks: !spei.exe 36 fallon_input.txt 36.txt
The characters in bold are the arguments that need to be changed within each loop.
Can anyone please help me with this?
Thanks, Dan

 採用された回答

Jan
Jan 2011 年 3 月 28 日

1 投票

for a = [36, 37, 38]
system(sprintf('spei.exe %d fallon_input.txt %d.txt', a, a));
end

1 件のコメント

Dan
Dan 2011 年 3 月 28 日
Thanks Jan, this is a HUGE help!

サインインしてコメントする。

その他の回答 (1 件)

Dan
Dan 2011 年 3 月 28 日

0 投票

Thanks Jan, this is a HUGE help!

カテゴリ

ヘルプ センター および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

質問済み:

Dan
2011 年 3 月 28 日

Community Treasure Hunt

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

Start Hunting!

Translated by