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

조회 수: 6 (최근 30일)
Dan
Dan 2011년 3월 28일
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일
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일
Thanks Jan, this is a HUGE help!

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by