if isunix [~, user_name] = system('whoami') % exists on every unix that I know of % on my mac, isunix == 1 elseif ispc [~, user_name] = system('echo %USERDOMAIN%\%USERNAME%') % Not as familiar with windows, % found it on the net elsewhere, you might want to verify end
Hope this helps! You might also want to include the else I'm confused
clause in case you find a system that is not unix or pc.
laaph source share