Get computer name/hostname

It provides the computer name where running. Useful for customizing scripts depending on the machine


Updated 12 Dec 2013

View License

GETCOMPUTERNAME is a very simple but useful function to get your computer name, i.e. the hostname.


> mycomputer = getComputerName();

Cite As

Manuel Marin (2023). Get computer name/hostname (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R14SP3
Compatible with any release
Platform Compatibility
Windows macOS Linux
Find more on Oceanography and Hydrology in Help Center and MATLAB Answers

Inspired: getUserName

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes

As suggested by some users, insignificant whitespaces are removed.

Summary updated