Run function with multiple arguments in terminal
2 次查看(过去 30 天)
显示 更早的评论
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
回答(1 个)
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
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 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!