Open an application from Matlab and send a txt input file automatically

Hi everyone,
I need to run an application from matlab, in particular it is a finite element solver that works as a dos window where an input .txt file is needed. What I need to do is create a script that automatically opens the solver and sends the input file to its dos window.
Could anybody help me with that?
Thanks in advance, Stefano

답변 (2개)

dpb
dpb 2014년 1월 27일
!your_executable_name <your_inputfile_name
May want to actually build a batch file you dispatch instead and let that file take care of mundane details of ensuring the DOS shell is operating in the correct directory and so on.
The secret is whether the app itself will run from command line with the input redirection -- you can try that by hand to make sure it was written to get an input filename from the command line.
If that doesn't work, then you'll have to use the batch file approach but build it to open the input as you do manually.
Stefano
Stefano 2014년 1월 27일

0 개 추천

Ok thanks. I've found the solution: a=[' "solver directory" "input file directory" '] dos(a); This way it works just fine, I was trying this approach but I was omitting " in the string.
Thanks again! Stefano

카테고리

도움말 센터File Exchange에서 File Operations에 대해 자세히 알아보기

태그

질문:

2014년 1월 27일

답변:

2014년 1월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by