Run function with multiple arguments in terminal

1 回表示 (過去 30 日間)
Haonan Tong
Haonan Tong 2017 年 6 月 25 日
コメント済み: Walter Roberson 2017 年 6 月 26 日
Hi,
I install Matlab2017a mac version and several function are written and corresponding protected files are generated.
I want to call the function in terminal and find out a way with command line "matlab -r 'function args'"
but error in "-bash: matlab: command not found"
What should I do? Thank you
  2 件のコメント
KSSV
KSSV 2017 年 6 月 25 日
What function you checked ?
Haonan Tong
Haonan Tong 2017 年 6 月 25 日
Self-defined function.

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

回答 (1 件)

Jan
Jan 2017 年 6 月 25 日
編集済み: Jan 2017 年 6 月 25 日
Is the installation folder of Matlab in your PATH? If not:
/Applications/MyMATLAB/MATLAB_R2015a.app/bin/matlab -r "yourFunction(Args)"
See these links, which can be found by asking Google (implicite hint):
  1 件のコメント
Walter Roberson
Walter Roberson 2017 年 6 月 26 日
If you are running from a shell script without a display, you might want to use
alias matlab='/Applications/MATLAB_R2017a.app/bin/matlab -nojvm -nodesktop'
in your ~/.bash_profile

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

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by