engOpen fails on Mac with "matlab: command not found"

When I execute engOpen(NULL) on a Mac in C++, I get "matlab: command not found". When I provide the complete path to the matlab command to engOpen(), I get "matlab: line 380: awk: command not found" and "matlab: line 396: expr: command not found".
Matlab works fine, i.e., "matlab -e" at the command prompt shows the environment.
I thought this was a problem with PATH, but if I export PATH with the Matlab bin folder included, it doesn't fix the problem.
Any ideas?

답변 (2개)

David Chassin
David Chassin 2012년 7월 2일

1 개 추천

Yes, we found a problem with the path related to cross platform compatibility. A path item was added using a semicolon (i.e., windows) instead of a colon (i.e., linux). The last item listed before it was added was the matlab bin directory so that go trashed. When we tried the direct path, that got trashed too.
Thanks.
Walter Roberson
Walter Roberson 2012년 7월 2일

0 개 추천

Odd, in OS-X (Leopard), I find /bin/expr and /usr/bin/awk .
Is your C++ program possibly fiddling with your PATH environment variable?

카테고리

도움말 센터File Exchange에서 Call MATLAB from C에 대해 자세히 알아보기

제품

태그

질문:

2012년 7월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by