How to get user homepath?
4 views (last 30 days)
I want to get the user homepath in windows, the same as when I type '%homepath%' in the file explorer.
I am currently using this:
home_path = strrep(userpath,'Documents\MATLAB','')
but I'm afraid it might not work for all users depending on the way they installed matlab.
Is there a less 'hardcoded' way to get the user homepath in windows?