title: Access Matlab Struct from mex
body: <p>I have a Structure from Matlab passed to mex. 
  It is passed correctly, I verified it with mxGetClassName(mxArray_pointer_carrying_struct) which returns <strong><em>struct</em></strong> as the class type. The struct has 15 fields n corresponding properties, all 30 Strings (15 property_names, 15 property_values).</p>
  
  <p>I am able to access property names using mxGetFieldNameByNumber(mxArray_pointer_carrying_struct, index);</p>
  
  <p>How can I access the property values?</p>
  
  <p>The code I have to do above looks as below:</p>
  
  <pre><code>extract_settings(const mxArray *p)
  {
      mwIndex j = 1;
      const char *property;
      mexPrintf("\nInput Arg %i is of type:%s\n",j,mxGetClassName(p));
      for(int i = 0;i&lt;=14;i++)
      {
          property = mxGetFieldNameByNumber(p, i);  %gets property names
          mexPrintf("%s-- \n",property); %Displays 15 property names
      }
  }
  </code></pre>
  
  <p>My struct Looks as below :</p>
  
  <pre><code>{ 
  TRIGGER_POLARITY : LEVEL_LOW
  EDGE : EDGE_RISING 
  . 
  .
  . (15 elements as of now)
  }
  </code></pre>