title: How to display a .bin image in Matlab?
body: <p>So I'm sure this is an incredibly simple question, but I'm having trouble reading and displaying data from a .bin file. Basically, I have an image (256x256, 8 bits per pixel) that I'm trying to read in and display. While I can get this to work for a .jpg or .tif, I can't get it to work for a .bin file. Here's my code as of now:</p>
  
  <pre><code>file = fopen('image.bin', 'r');
  A = fread(file);
  imshow(A) %not sure if this is correct...
  % imshow(file) doesn't work
  % imshow('image.bin') doesn't work either
  fclose(file);
  </code></pre>
  
  <p>Any ideas?</p>