MATLAB Answers

0

How can I use "system" command with input without typing myself all the input everytimes ?

Asked by Loïc Videau on 30 Jul 2019
Latest activity Commented on by Loïc Videau on 30 Jul 2019
Accepted Answer by Jan
Hello everyone,
I would like to use the system command in order to call a program which needs some information to be run.
The program that i want to use is called "dammif" and allow me to get the shape of some molecule. This program, when i run it, ask me things like unit or the name of the output file(and a lot of other things). I have to run dammif a lot and i would like to use matlab to run dammif for me when I'm not at work.
I look system's documentation but i didn't understand the 'echo' thing...
On the picture, dammif ask me for the gnom file I want to read, this gnom file is called 'gnom_med_320.out' but i don't know what I can do so matlab automatically fill this question with 'gnom_med_320.out' for instance. Is there a way to do it ?question.pngI hope I'm clear.
thank you for your help !

  0 Comments

Sign in to comment.

1 Answer

Answer by Jan
on 30 Jul 2019
 Accepted Answer

Please take a look into the documentation of dammif: https://www.embl-hamburg.de/biosaxs/manuals/dammif.html
Here you can see how to call this 3rd party tool with input arguments, such that you do not have to type them in dynamically. Use Matlab's sprintf to create the corresponding string, which is uses as input for the system command.

  1 Comment

Thank you very much ! I didn't knew sprintf function but it work !
I know the documentation of dammif but i needed to run it in interactive mode to change an option in particular !
thank you again for your rapidity,
Loïc

Sign in to comment.