How to get the name of the computer under MATLAB?
160 ビュー (過去 30 日間)
古いコメントを表示
I want to register the name of the computer where my script is running. Is it possible to get this info?
0 件のコメント
回答 (2 件)
Ameer Hamza
2018 年 4 月 29 日
[ret, name] = system('hostname')
name = getenv('COMPUTERNAME'); % for windows
name = getenv('HOSTNAME')
1 件のコメント
nan
2020 年 8 月 18 日
This does not work when running a VPN on a Mac (running Catalina); the hostname is replaced by an IP address.
参考
カテゴリ
Help Center および File Exchange で Startup and Shutdown についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!