Pārlūkot izejas kodu

simplified getLocalIp.m

master
Wouter Horlings pirms 8 gadiem
vecāks
revīzija
9bc36faa4b
1 mainītis faili ar 7 papildinājumiem un 8 dzēšanām
  1. +7
    -8
      OOequipment/subfiles/getLocalIP.m

+ 7
- 8
OOequipment/subfiles/getLocalIP.m Parādīt failu

@@ -6,15 +6,14 @@ function [ ipaddress ] = getLocalIP()
if ~(status == 0)
error('Failed to find local IP address');
end
[startIndex,endIndex] = regexp(result,'(?<=\n IPv4 Address[ \.]*: )([0-9]{1,3}\.?){4}');
if isempty(startIndex)
error('Failed to find local IP address');
end
for i = 1:length(startIndex)
ipaddress{i} = result(startIndex(i):endIndex(i));
end
ipaddress = regexp(result,'(?<=\n IPv4 Address[ \.]*: )([0-9]{1,3}\.?){4}','match');
elseif ismac
% Code to run on Mac platform
elseif isunix
% Code to run on Unix platform
else
error('Function only available on Windows');
error('Platform not supported');
end
end


Notiek ielāde…
Atcelt
Saglabāt