hostname.m

Report the name of computer on which Matlab is currently running.

You are now following this Submission

This function reports the name of computer on which Matlab is currently running, and works under multiple operating systems.

Cite As

Phillip M. Feldman (2026). hostname.m (https://www.mathworks.com/matlabcentral/fileexchange/24096-hostname-m), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.3.0.0

I updated this to support both the newer and older Mac environments.

1.2.0.0

Added one line of code to strip any trailing blanks from the result.

1.1.0.0

minor modification to support Mac

1.0.0.0