来自Matlab shell的系统命令(Mac OS)

时间:2014-05-29 19:12:26

标签: macos matlab shell gmt

我需要调用gmt命令表单matlab脚本。在标准的Mac OS shell中,我配置了所有路径,gmt工作正常。当我开始matlab时,结果如下:

>> !gmt

/bin/bash: gmt: command not found

当我添加路径时:

>> setenv('PATH', [getenv('PATH') ':' '/Applications/GMT-5.1.1.app/Contents/Resources/lib/']);

问题变为:

>> !gmt

dyld: Library not loaded: @executable_path/../lib/libnetcdf.7.dylib
  Referenced from: /Applications/GMT-5.1.1.app/Contents/Resources/bin/gmt
  Reason: Incompatible library version: gmt requires version 10.0.0 or later, but libnetcdf.7.dylib provides version 9.0.0

gmt: Trace/breakpoint trap

我不知道从哪里开始。

在Windows上这很好用,但我更喜欢使用mac。

1 个答案:

答案 0 :(得分:1)

好的,解决了:

setenv('DYLD_LIBRARY_PATH', '/usr/local/bin/');