I am launching a MATLAB project that is used by several users, some of whom are running Windows and some running Linux.
In some scenarios, I need to access files that are in external directories and which I do not want to add to the MATLAB path.
To host both Linux and Windows, I need to determine the type of operating system that I am running and set the directory separator accordingly ('\' for Windows, '/' for Linux).
I tried
os = getenv('OS')
(which I saw in some official manual), but it returns an empty string.
I could check the first βpwdβ character, but it's pretty ugly, and I expect there should be something simpler.
Thanks for any suggestions!
source
share