Watch this Author's files
the current zip only contains a single .m and nothing can be done. Could you please add the remaining files?
Just this works fine.
[~, name] = system(hostname');
This is not worth a function.
@Ken Why is strtrim better? Are you having problems with whitespace at the beginning of your hostname string?