如何从命令行运行Matlab? [英] How to run Matlab from the command line?
问题描述
是否可以从Mac命令行运行Matlab命令?
Is it possible to run Matlab commands from Mac command line?
推荐答案
matlab
脚本位于MATLAB应用程序捆绑包的bin
子目录中.在我的机器上,这意味着我可以像这样运行它:
The matlab
script is in the bin
subdirectory of the MATLAB app bundle. On my machine, this means I can run it like so:
/Applications/MATLAB_R2012a_Student.app/bin/matlab
如果要在路径上使用此bin目录(以便仅运行matlab
,mex
等),请使用以下命令在主目录的顶层编辑或创建一个名为.bash_profile
的新文本文件:以下行:
If you want this bin directory on your path (so that you can just run matlab
, mex
, etc), edit or create a new text file called .bash_profile
in the top level of your home directory with the following line:
export PATH=/Applications/MATLAB_R2012a_Student.app/bin:$PATH
将"MATLAB_R2012a_Student"部分替换为实际MATLAB应用程序包的名称.这对于当前打开的终端不会生效,但是新打开的终端应该可以正常工作.
Replacing the "MATLAB_R2012a_Student" part with the name of your actual MATLAB app bundle. This will not come into effect for currently open terminals, but newly opened terminals should work properly.
这篇关于如何从命令行运行Matlab?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!