title: Matlab: Names of the variables in a struct
body: <p>Given a struct from a function with a number of unknown fields, how do I get the name of each field? </p>
  
  <p>For example:</p>
  
  <pre><code>s = struct;
  s.hello = 'world';
  s.foo = 12;
  s.bar = [ 1 2 3 ];
  </code></pre>
  
  <p>I want the name of s(1), s(2) and s(3). In this case I would get 'hello', 'foo' and 'bar'.</p>