title: Reading the Fortran real data type into Matlab from a hex dump
body: <p>As the title says I am writing a large amount of real arrays from Fortran into an unformatted file, and then trying to read that binary file into Matlab. I have successfully made my script work for strings and integers, but It does not correctly read my real numbers from the hex dump. </p>
  
  <p>As a test case I was using the number 5.49. Interesting side note, according to an online converter that is <code>40 af ae 14</code>, yet when I check my hexfile that portion of my code is reading <code>14 ae af 40</code>. I have tried reading it in as a <code>float32</code> and <code>double</code>,  and I have changed fro neutral to little endian to big endian. Any ideas?</p>
  
  <p>Here is a simple example of my code:</p>
  
  <p>First the Fortran write statements</p>
  
  <pre><code>REAL :: floating = 5.49
  open(unit = 2, file = "anxietySource", form = "unformatted", status = "new", action = "readwrite")
  write(unit = 2 ) floating 
  </code></pre>
  
  <p>Now the Matlab read statement</p>
  
  <pre><code>fid = fopen('anxietySource', 'rb');
  h1 = fread(fid, 1, 'int32'); %this is just reading off the starter bits that tell me how long my write statement is
  floating = fread(fid,1,'float32');
  display(floating);
  fclose(fid);
  </code></pre>
  
  <p>My guess is that there is something funky with the Fortran <code>REAL</code> type. Maybe it's not quite a floating point? </p>