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).
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>
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With