How to get the name of the computer under MATLAB?

 Respuesta aceptada

Ameer Hamza
Ameer Hamza el 29 de Abr. de 2018
Check this FEX submission. Or you can simply try following commands
[ret, name] = system('hostname')
name = getenv('COMPUTERNAME'); % for windows
name = getenv('HOSTNAME')

1 comentario

nan
nan el 18 de Ag. de 2020
This does not work when running a VPN on a Mac (running Catalina); the hostname is replaced by an IP address.

Iniciar sesión para comentar.

Más respuestas (1)

scivision
scivision el 18 de Sept. de 2024
Get the hostname of the local machine with built-in Java
name = string(java.net.InetAddress.getLocalHost().getHostName());

Categorías

Más información sobre Startup and Shutdown en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 29 de Abr. de 2018

Respondida:

el 18 de Sept. de 2024

Community Treasure Hunt

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

Start Hunting!

Translated by