I experienced this problem on mac if the 'userpath' points to a path with spaces in the pathname. Set your 'userpath' to something which does not contain spaces. For example,
userpath('/Users/ameerhamzakhan/Documents/MATLAB/')
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!