title: Get (consistent) computer name in MATLAB
body: <p>I occasionally need to customise MATLAB scripts depending on the machine it is being run on. I usually use the following command to grab the computer name:</p>
  
  <pre><code>char(getHostName(java.net.InetAddress.getLocalHost)
  </code></pre>
  
  <p>This returns a computer name in <em>most</em> cases. However, my laptop (a MacBook) varies depending on which network I am connected to.</p>
  
  <p>Is there a way of retrieving some sort of unique identifier about the computer that <em>does not change</em> depending on the network it is connected to?</p>
  
  <p><strong>Update</strong>: I forgot to mention that I am looking for a solution that is OS independent. I need to find a command that works whether on Mac, PC or Linux.</p>