GETUSERDIR returns the user home directory using the registry on windows systems and using Java on non windows systems as a string
As I am not familiar with non windows operating systems please give me information about incompatibilities - I rely on JAVA in this function
Nice bit of code - just what I was looking for.
@ andy a: getenv('USERPROFILE') gets the root of your Windows profile. By default your "My Documents" folder will be directly under this root. Fowever, getenv('USERPROFILE') will not get your "My Documents" folder if you have changed it from the default (e.g. to another partition to separate data and operating system files).
Why not just this
if ispc; userdir= getenv('USERPROFILE');
else; userdir= getenv('HOME');
Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.