How to define the output path of THE "system" command
Mostra commenti meno recenti
Hi all,
I use Matlab script to call Abaqus. The command I use is:
system('/home/xiaohan/abaqus/6.14-1/code/bin/abq6141 noGUI job=L2H1_dynamics inp=/home/xiaohan/AbaqusModels/L2H1_dynamics.inp interactive ask_delete=OFF')
This command runs completely fine, but the outputs exist in current Matlab path, which is not the location I want to store the outputs. So my question is, when using the "system" command, how can I specify the output location (like I did when specify the location of the Abaqus job?)?
9 Commenti
Geoff Hayes
il 6 Mar 2018
Xiaohan - it looks like all of the parameters you have defined (noGUI, job, inp, etc.) are being passed to Abacus. Does Abacus not have an option to define the location of the output files?
Xiaohan Du
il 6 Mar 2018
Geoff Hayes
il 6 Mar 2018
But isn't the input file path (inp=) an input parameter to Abacus (like all of your other input parameters) rather than to MATLAB? I do realize that you are using executing Abacus from the command line so I'm surprised that it doesn't offer the ability to set the output path. An alternative is to change directory to the folder that you wish to save the files to before executing your command
>> cd /home/xiaohan/someFolder
>> system('..')
Geoff Hayes
il 6 Mar 2018
As the Abacus app is writing the data to file, it is probably just assuming that it should be written to the default folder from where the app is launched...which would be the current MATLAB path.
Xiaohan Du
il 6 Mar 2018
Geoff Hayes
il 6 Mar 2018
right, and I don't think that you can do this from MATLAB since it is Abacus that is deciding where to write the output files to.
Xiaohan Du
il 6 Mar 2018
Geoff Hayes
il 6 Mar 2018
you could add some MATLAB code to move those files from the current working directory to some pre-defined location (if you know which files to move and to where). that way you don't have to really care about where you are executing the code from.
Xiaohan Du
il 6 Mar 2018
Risposte (0)
Categorie
Scopri di più su File Operations in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!