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

Respuestas (2)

!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 el 27 de En. de 2014
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

Categorías

Más información sobre File Operations en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 27 de En. de 2014

Respondida:

el 27 de En. de 2014

Community Treasure Hunt

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

Start Hunting!

Translated by