Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List all environment variables in Matlab

How does one get a list of all defined environment variables in Matlab? I'm aware of getenv but you have to provide a name, and doc getenv offers no help in how to use it to retrieve items in any other way. I can't find any other relevant information online. Is this even possible?

I'm interested in a platform-independent answer (or at least Windows and Linux).

like image 762
pattivacek Avatar asked Nov 15 '13 15:11

pattivacek


1 Answers

You could use

system('env')

on linux/mac, and

system('set') % hope I remember correctly, no windows at hand

In both cases you'd have to parse the output though, as it comes in the format variable=<variable-value>.

like image 188
sebastian Avatar answered Sep 19 '22 14:09

sebastian