Clear Filters
Clear Filters

setenv not working properly?

11 views (last 30 days)
Guy Nir
Guy Nir on 19 Sep 2017
Commented: Guy Nir on 19 Sep 2017
setenv and getenv used to work nicely for me, and enabled me to call other scripts using the unix command. recently it stopped working. Not sure when, but i am now using MATLAB 2017a, and mac OS Sierra 10.12.6.
For instance, from matlab command line:
unix('which perl') /bin/bash: which: command not found
ans =
While, from terminal:
which perl
Although i have defined the following on my startup.m: setenv('PATH','usr/bin:/usr/local/bin');
Does anyone know how to fix this? Thanks, Guy

Accepted Answer

Walter Roberson
Walter Roberson on 19 Sep 2017
You were missing a '/' before 'usr/bin'
  1 Comment
Guy Nir
Guy Nir on 19 Sep 2017
Wow! I would have never notice that! Thank you!

Sign in to comment.

More Answers (0)


Find more on Get Started with MATLAB in Help Center and File Exchange


Community Treasure Hunt

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

Start Hunting!