MATLAB 帮助中心
Resolve network host name or IP address
name = resolvehost(host)
name = resolvehost(host,"name")
address = resolvehost(host,"address")
[name,address] = resolvehost(host)
name = resolvehost(host) and name = resolvehost(host,"name") return the name of the specified host, where host is the network name or IP address.
name
host
example
address = resolvehost(host,"address") returns the address of the specified host.
address
[name,address] = resolvehost(host) returns both the name and address of the specified host.
collapse all
Provide an IP address to view the associated host name.
name = resolvehost("144.212.244.17")
name = 'www-ahprod.mathworks.com'
You can specify the optional input argument "name" as well.
"name"
name = resolvehost("144.212.244.17","name")
Specifying the host name instead returns the same host name.
name = resolvehost("www.mathworks.com")
name = 'www.mathworks.com'
Provide a network host name to view the associated IP address. You must include the input argument "address".
"address"
address = resolvehost("en.wikipedia.org","address")
address = '208.80.154.224'
Specifying the IP address instead returns the same IP address.
address = resolvehost("208.80.154.224","address")
You can view both the network name and IP address of a specified host. You can specify either the name or IP address. In this example, the resolvehost function returns the name and address from the provided host name.
resolvehost
[name,address] = resolvehost("en.wikipedia.org")
name = 'en.wikipedia.org'
You can also specify the IP address instead.
[name,address] = resolvehost("208.80.154.224")
name = 'text-lb.eqiad.wikimedia.org'
Network host name or IP address, specified as a character vector or string scalar.
Data Types: char | string
char
string
Network name, returned as a character vector.
IP address, returned as a character vector.
Introduced before R2006a
tcpclient | udpport
tcpclient
udpport
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
欧洲
亚太
联系您当地的办事处