MATLAB REAL-TIME WORKSHOP 7 - TARGET LANGUAGE COMPILER Manual do Utilizador Página 237

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 408
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 236
Example – Finding an Internet Protocol Address
5-67
3. Display the Hostname or IP Address
The example uses the MATLAB strcmp function to compare the input
argument to the resolved IP address. If it matches, MATLAB displays the
hostname for the internet address. If the input does not match, MATLAB
displays the IP address.
if strcmp(input,ipaddress)
disp(sprintf('Host name of %s is %s', input, hostname));
else
disp(sprintf('IP address of %s is %s', input, ipaddress));
end;
Running the Example
Here is an example of calling the resolveip function with a hostname.
resolveip ('www.mathworks.com')
IP address of www.mathworks.com is 144.212.100.10
Here is a call to the function with an IP address.
resolveip ('144.212.100.10')
Host name of 144.212.100.10 is www.mathworks.com
Vista de página 236
1 2 ... 232 233 234 235 236 237 238 239 240 241 242 ... 407 408

Comentários a estes Manuais

Sem comentários