Run matlab commands from a bash script

I'm wirting a shell script to automate a few tasks. From my shell script I start Matlab with the following line:
matlab -nosplash -nodesktop
After startting matlab I want to run a few commands for example:
path(path,'path to be added')
How do I feed these commands to my open instantiation of Matlab?

 採用された回答

Steven Lord
Steven Lord 2019 年 10 月 22 日

0 投票

If you're using release R2019a or later, use the -batch startup option.
If you're using an earlier release, use the -r startup option.
Follow -batch or -r with the name of the script or function you want to execute or the list of commands you want to execute.

1 件のコメント

Michael Joslin
Michael Joslin 2019 年 10 月 22 日
編集済み: Michael Joslin 2019 年 10 月 22 日
Great, thank you!

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeStartup and Shutdown についてさらに検索

タグ

質問済み:

2019 年 10 月 22 日

編集済み:

2019 年 10 月 22 日

Community Treasure Hunt

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

Start Hunting!

Translated by