OptFEM3DP1 Toolbox  V1.0
Matlab/Octave Optimized P1-Lagrange Finite Element Method in 3D
 All Files Functions Variables Pages
getComputerName.m
Go to the documentation of this file.
1 function name = getComputerName()
2 % GETCOMPUTERNAME returns the name of the computer (hostname)
3 % name = getComputerName()
4 %
5 % WARN: output string is converted to lower case
6 %
7 %
8 % See also SYSTEM, GETENV, ISPC, ISUNIX
9 %
10 % m j m a r i n j (AT) y a h o o (DOT) e s
11 % (c) MJMJ/2007
12 %
13 % Copyright:
14 % See \ref license
15 if isOctave()
16  name=gethostname();
17 else
18  [ret, name] = system('hostname');
19 
20  if ret ~= 0,
21  if ispc
22  name = getenv('COMPUTERNAME');
23  else
24  name = getenv('HOSTNAME');
25  end
26  end
27  name = lower(name);
28  I=strfind(name,'.');
29  if ~isempty(I)
30  name=name(1:I(1)-1);
31  end
32  I=strfind(name,char(10));
33  if ~isempty(I)
34  name=name(1:I(1)-1);
35  end
36  %if ( name(end) == 10 )
37  % name=name(1:end-1);
38  %end
39 end
40 
41