Run function with multiple arguments in terminal

2 Ansichten (letzte 30 Tage)
Haonan Tong
Haonan Tong am 25 Jun. 2017
Kommentiert: Walter Roberson am 26 Jun. 2017
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 Kommentare
KSSV
KSSV am 25 Jun. 2017
What function you checked ?
Haonan Tong
Haonan Tong am 25 Jun. 2017
Self-defined function.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Jan
Jan am 25 Jun. 2017
Bearbeitet: Jan am 25 Jun. 2017
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 Kommentar
Walter Roberson
Walter Roberson am 26 Jun. 2017
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

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Introduction to Installation and Licensing finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by