Home > atmlab > handy > hostname.m

hostname

PURPOSE ^

HOSTNAME Returns name of computer

SYNOPSIS ^

function hname = hostname

DESCRIPTION ^

 HOSTNAME   Returns name of computer

 FORMAT   hname = hostname
        
 OUT   hname   String with computer name.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

hostname.m

SOURCE CODE ^

0001 % HOSTNAME   Returns name of computer
0002 %
0003 % FORMAT   hname = hostname
0004 %
0005 % OUT   hname   String with computer name.
0006 
0007 % 2005-02-15   Created by Patrick Eriksson.
0008 
0009 
0010 function hname = hostname
0011 
0012 
0013 [st,hname] = system( 'hostname' );
0014 
0015 %- Remove any newline character
0016 %
0017 if hname(end) == sprintf('\n')
0018   hname = hname(1:end-1);
0019 end

Generated on Mon 15-Sep-2014 13:31:28 by m2html © 2005