Can a Matlab script launch a program on my computer?

The heading says it all. I want to launch a program (Mechanical APDL) that is installed on my computer from Matlab within a script. Is there a convenient way to do this with Matlab?

 採用された回答

Walter Roberson
Walter Roberson 2020 年 3 月 13 日
編集済み: Walter Roberson 2020 年 3 月 15 日

0 投票

system() with a character vector that is a command line. https://www.padtinc.com/blog/starting-ansys-products-from-the-command-line/

1 件のコメント

Jóhann Egholm Vørmadal
Jóhann Egholm Vørmadal 2020 年 3 月 15 日
編集済み: Jóhann Egholm Vørmadal 2020 年 3 月 15 日
Ah thanks, i really appreciate that. The link was brilliant.
This is what i ended up using:
com=['"MAPDL.exe" -g -p aa_t_i -smp -np 2 -lch -dir "'
directory
'" -j "Run_Optimization" -s read -l en-us -aas -t -d win32 &'];
system(com)
where the variable 'directory' is the absolute path of the apdl working directory.
For an ordinary installation of MAPDL the absolute path must be used in front of 'MAPDL.exe'
What i did to avoid this was to set its path as an environment variable on my system.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeInstall Products についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by