Run function with multiple arguments in terminal

조회 수: 2 (최근 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 CenterFile Exchange에서 Introduction 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