MATLAB: Can I change the location of Malab preference folder via an environment variable

environment variablepreference

Hello all,
I would like to have different sets of preferences and be able to switch to one of them when starting Matlab.
Normally the preferences are stored in Matlab preferences directory. You can find out where it is located from prefdir command.
Is there an environment variable which controls this location? I'd set this variable to one location or another depending on my needs before starting Matlab. Or any other way of doing it?
Thank you

Best Answer