How to define the output path of THE "system" command

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

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?
Geoff - I believe Abaqus has an option to specify the location of output files when using GUI (by clicking a few buttons), but as you see, the code I use to call Abaqus is running without GUI, only invoking Abaqus cores. So I think I have to define the output path with Matlab commands. Problem is I cannot find out how to do this. (I can specify the input file path, therefore I believe I can specify the similar output path).
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('..')
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.
Yes you are right, if using Abaqus CAE with GUI, there is indeed a default output location, which is where Abaqus is installed. However, when using "system" command to call Abaqus from Matlab, the output just resides in the current work directory (meaning if user switches among different directories, the outputs reside differently too. This is not ideal cause usually we just want the outputs to be located somewhere fixed and easy to find).
I'm actually using the same method as yours: cd to the directory I want before executing the command. But I guess this is not the best method, it's better to specify the output location rather than changing the working directory.
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.
Thanks, I'll stick to the current method for now.
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.
sounds good, let me have a try. If you provide an answer below I'll accept it.

Accedi per commentare.

Risposte (0)

Categorie

Richiesto:

il 6 Mar 2018

Commentato:

il 6 Mar 2018

Community Treasure Hunt

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

Start Hunting!

Translated by