title: Convert struct to double type in Matlab
body: <p>Glcm (feature extraction method) give me an output in 'struct' type, while i need the output in 'double' type. I need a 'double' type as the input variable for the next step.</p>
  
  <p><a href="https://i.stack.imgur.com/UWjv1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UWjv1.png" alt="enter image description here"></a></p>
  
  <p>So, I've tried to convert it using several code showed below.</p>
  
  <pre><code>[gl] = glcm (B);
  [gl] = struct2cell (gl);
  [gl] = cell2mat (gl);
  [fetrain] = double (gl);
  </code></pre>
  
  <p>The code give me an output but it's in 'complex double' type.</p>
  
  <p><a href="https://i.stack.imgur.com/3WMhM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3WMhM.png" alt="enter image description here"></a></p>
  
  <p>Is there a better way to convert 'struct' to 'double' type?</p>
  
  <p>Or to convert 'complex double' to 'double' type?</p>
  
  <p>Any help and suggestion would be very appreciated. Thank you.</p>