external (! echo $PATH) in Matlab for MacOSX

9 ビュー (過去 30 日間)
Jesús
Jesús 2019 年 2 月 24 日
編集済み: Geoff Hayes 2019 年 2 月 25 日
Hi:
I am using several scripts.m in matlab. These scripts use external terminal commands located in several directories.
The problem is that the "!echo $PATH" answer is different when starting matlab by double click and starting matlab as a terminal command
double click:
>> !echo $PATH
/usr/bin:/bin:/usr/sbin:/sbin
terminal command:
>> !echo $PATH
/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin
How can I change this behaviour?
Regards
jpeinado
  2 件のコメント
Geoff Hayes
Geoff Hayes 2019 年 2 月 25 日
J - I observe the same behaviour...but why is that important? How are you using !echo $PATH in your code?
Geoff Hayes
Geoff Hayes 2019 年 2 月 25 日
編集済み: Geoff Hayes 2019 年 2 月 25 日
J's answer moved here
Hi Geoff:
Both paths are different. The problem is not the !echo PATH command
This is important because in my code, I use some terminal commands.
The commands are found when MATLAB uses the second path, not the first one.
What I wanted to know is how can I configure MATLAB for using the same path in both cases. When starting MATLAB from the terminal, the path is obtained from bash. But I dont know how to get this path when staring MATLAB by clicking on Finder.
jpeinado

サインインしてコメントする。

回答 (2 件)

Jesús
Jesús 2019 年 2 月 25 日
Hi Geoff:
You edited my question as yours. What happened?. is this a mistake?
jpeinado
  1 件のコメント
Geoff Hayes
Geoff Hayes 2019 年 2 月 25 日
編集済み: Geoff Hayes 2019 年 2 月 25 日
I just deleted your answer and made it into a comment (since it wasn't an answer to the question). Just like your "answer" here should be a comment to the thread above.

サインインしてコメントする。


Jesús
Jesús 2019 年 2 月 25 日
Thank you very much Geoff.
Please if possible edit my comment...change stating-->starting :-)
jpeinado

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

製品


リリース

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by