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

8 views (last 30 days)
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 !

Accepted Answer

Jan
Jan on 30 Jul 2019
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
Loïc Videau
Loïc Videau on 30 Jul 2019
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.

More Answers (0)

Categories

Find more on MATLAB in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!